From b4ca5bfda378d2029e72942b1cc74dff7f00656d Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Mon, 10 Oct 2022 18:19:24 -0400 Subject: [PATCH] fix(readline): put cursor at end of text when exiting editor --- readline/vim.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/readline/vim.go b/readline/vim.go index 886927b..d496705 100644 --- a/readline/vim.go +++ b/readline/vim.go @@ -245,7 +245,7 @@ func (rl *Instance) vi(r rune) { } // Keep the previous cursor position - prev := rl.pos + //prev := rl.pos new, err := rl.StartEditorWithBuffer(multiline, "") if err != nil || len(new) == 0 || string(new) == string(multiline) { @@ -257,11 +257,11 @@ func (rl *Instance) vi(r rune) { // Clean the shell and put the new buffer, with adjusted pos if needed. rl.clearLine() rl.line = new - if prev > len(rl.line) { - rl.pos = len(rl.line) - 1 + rl.pos = len(rl.line) + /*if prev > len(rl.line) { } else { rl.pos = prev - } + }*/ case 'w': // If we were not yanking