]> git.lizzy.rs Git - micro.git/blobdiff - cmd/micro/command.go
Add scrollmargin option, rename scrollSpeed to scrollspeed for consistency, make...
[micro.git] / cmd / micro / command.go
index e5565a375759b8354445830801efdde246c05312..00badd61caf9885ca7eff985bb9a625f84880b01 100644 (file)
@@ -141,7 +141,7 @@ func HandleCommand(input string, view *View) {
 
                found := false
                for {
-                       match := regex.FindStringIndex(view.Buf.Text)
+                       match := regex.FindStringIndex(view.Buf.String())
                        if match == nil {
                                break
                        }
@@ -149,7 +149,8 @@ func HandleCommand(input string, view *View) {
                        if strings.Contains(flags, "c") {
                                // The 'check' flag was used
                                Search(search, view, true)
-                               view.Relocate()
+                               scrollmargin := int(settings["scrollmargin"].(float64))
+                               view.Relocate(scrollmargin)
                                Redraw(view)
                                choice, canceled := messenger.YesNoPrompt("Perform replacement? (y,n)")
                                if canceled {