Fix cursor position after accepting Vi mode autosuggestion

Closes #12430
This commit is contained in:
Johannes Altmanninger
2026-02-08 11:58:18 +11:00
parent 0589de7523
commit 002fa0e791
3 changed files with 10 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ fish ?.?.? (released ???)
Regression fixes:
-----------------
- (from 4.4.0) Vi mode ``d,f`` key binding (:issue:`12417`).
- (from 4.4.0) Vi mode crash on ``c,i,w`` after accepting autosuggestion (:issue:`12430`).
- (from 4.4.0) ``fish_vi_key_bindings`` called with mode argument (:issue:`12413`).
fish 4.4.0 (released February 03, 2026)

View File

@@ -5683,6 +5683,7 @@ fn accept_autosuggestion(&mut self, amount: AutosuggestionPortion) {
};
self.data
.replace_substring(EditableLineTag::Commandline, range, replacement);
self.update_buff_pos(self.active_edit_line_tag(), None);
}
}

View File

@@ -20,3 +20,11 @@ send(2 * "dge")
sendline("")
expect_re(r"\bvi\b")
expect_prompt()
sendline("echo suggest-this")
send("ech")
send("\033")
sleep(1)
send("li123")
sendline("")
expect_re(r"\bsuggest-thi123s\b")