From f27d60f8277d54ac9cebd3bdfbbff29d35663ab5 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Mon, 21 Mar 2022 06:47:14 -0400 Subject: [PATCH] fix: move cursor to end of line on history search (closes #121) --- readline/readline.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readline/readline.go b/readline/readline.go index 41c04e9..7a10b7a 100644 --- a/readline/readline.go +++ b/readline/readline.go @@ -626,6 +626,8 @@ func (rl *Instance) escapeSeq(r []rune) { } rl.mainHist = true rl.walkHistory(1) + moveCursorForwards(len(rl.line) - rl.pos) + rl.pos = len(rl.line) case seqDown: if rl.modeTabCompletion { @@ -637,6 +639,8 @@ func (rl *Instance) escapeSeq(r []rune) { } rl.mainHist = true rl.walkHistory(-1) + moveCursorForwards(len(rl.line) - rl.pos) + rl.pos = len(rl.line) case seqForwards: if rl.modeTabCompletion {