From 213bb6fabe4a40f0a85b53a19369c2c36d48f85b Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Tue, 17 May 2016 12:36:41 -0400 Subject: [PATCH] Fix find where the match indicies are the same Fixes #113 --- cmd/micro/search.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/micro/search.go b/cmd/micro/search.go index 4253a316..734c0712 100644 --- a/cmd/micro/search.go +++ b/cmd/micro/search.go @@ -111,6 +111,10 @@ func Search(searchStr string, v *View, down bool) { match = matches[0] } + if match[0] == match[1] { + return + } + v.Cursor.curSelection[0] = charPos + match[0] v.Cursor.curSelection[1] = charPos + match[1] v.Cursor.x, v.Cursor.y = FromCharPos(charPos+match[1]-1, v.Buf)