From fce5b81c229ee79313db11dddaeee4ab358e23da Mon Sep 17 00:00:00 2001 From: boombuler Date: Sun, 4 Sep 2016 09:29:26 +0200 Subject: [PATCH] exit conditional replace if no match is left --- cmd/micro/command.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/micro/command.go b/cmd/micro/command.go index 450407be..a6cb7161 100644 --- a/cmd/micro/command.go +++ b/cmd/micro/command.go @@ -291,6 +291,9 @@ func Replace(args []string) { for { // The 'check' flag was used Search(search, view, true) + if !view.Cursor.HasSelection() { + break + } view.Relocate() if view.Buf.Settings["syntax"].(bool) { view.matches = Match(view)