]> git.lizzy.rs Git - micro.git/blobdiff - cmd/micro/command.go
Fix crash
[micro.git] / cmd / micro / command.go
index 00badd61caf9885ca7eff985bb9a625f84880b01..dac6ed58a7bbf7d03f1f63e7d82f2adfb60370e2 100644 (file)
@@ -149,8 +149,7 @@ func HandleCommand(input string, view *View) {
                        if strings.Contains(flags, "c") {
                                // The 'check' flag was used
                                Search(search, view, true)
-                               scrollmargin := int(settings["scrollmargin"].(float64))
-                               view.Relocate(scrollmargin)
+                               view.Relocate()
                                Redraw(view)
                                choice, canceled := messenger.YesNoPrompt("Perform replacement? (y,n)")
                                if canceled {
@@ -163,7 +162,7 @@ func HandleCommand(input string, view *View) {
                                }
                                if choice {
                                        view.Cursor.DeleteSelection()
-                                       view.eh.Insert(match[0], replace)
+                                       view.Buf.Insert(match[0], replace)
                                        view.Cursor.ResetSelection()
                                        messenger.Reset()
                                } else {
@@ -175,7 +174,7 @@ func HandleCommand(input string, view *View) {
                                        continue
                                }
                        } else {
-                               view.eh.Replace(match[0], match[1], replace)
+                               view.Buf.Replace(match[0], match[1], replace)
                        }
                }
                if !found {