]> git.lizzy.rs Git - micro.git/commitdiff
Add JumpLine action back
authorZachary Yedidia <zyedidia@gmail.com>
Tue, 3 Mar 2020 01:09:19 +0000 (20:09 -0500)
committerZachary Yedidia <zyedidia@gmail.com>
Tue, 3 Mar 2020 01:09:19 +0000 (20:09 -0500)
You can bind to "command-edit:goto ", but binding to the action
"JumpLine" will have the same effect now.

Fixes #1550

internal/action/actions.go
internal/action/bufpane.go

index c13b8c45df5fa6b8a15a4dff017bee35034a8264..d176096f17f1c58c2b1e5217eff1048d1a88da23 100644 (file)
@@ -1120,6 +1120,16 @@ func (h *BufPane) OpenFile() bool {
        return true
 }
 
+// OpenFile opens a new file in the buffer
+func (h *BufPane) JumpLine() bool {
+       InfoBar.Prompt("> ", "goto ", "Command", nil, func(resp string, canceled bool) {
+               if !canceled {
+                       h.HandleCommand(resp)
+               }
+       })
+       return true
+}
+
 // Start moves the viewport to the start of the buffer
 func (h *BufPane) Start() bool {
        v := h.GetView()
index 7351f1f76fe2b62f1522b74e09d3ba7ad20ca9b6..a7a7d91b21a3840f9739d468f52284605c48768a 100644 (file)
@@ -615,6 +615,7 @@ var BufKeyActions = map[string]BufKeyAction{
        "RemoveAllMultiCursors":  (*BufPane).RemoveAllMultiCursors,
        "SkipMultiCursor":        (*BufPane).SkipMultiCursor,
        "JumpToMatchingBrace":    (*BufPane).JumpToMatchingBrace,
+       "JumpLine":               (*BufPane).JumpLine,
        "None":                   (*BufPane).None,
 
        // This was changed to InsertNewline but I don't want to break backwards compatibility