From 629efe5eb79f5c46d00745a463bd742208886001 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Mon, 2 Mar 2020 20:09:19 -0500 Subject: [PATCH] Add JumpLine action back 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 | 10 ++++++++++ internal/action/bufpane.go | 1 + 2 files changed, 11 insertions(+) diff --git a/internal/action/actions.go b/internal/action/actions.go index c13b8c45..d176096f 100644 --- a/internal/action/actions.go +++ b/internal/action/actions.go @@ -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() diff --git a/internal/action/bufpane.go b/internal/action/bufpane.go index 7351f1f7..a7a7d91b 100644 --- a/internal/action/bufpane.go +++ b/internal/action/bufpane.go @@ -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