mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-27 16:51:15 -03:00
forward-char: respect fish_cursor_end_mode again
Fixes bbb2f0de8d (feat(vi-mode): make word movements vi-compliant,
2026-01-10).
When setting cursor pos, we need to make sure to call update_buff_pos,
which knows whether the one-past-last character ought to be selectable.
This commit is contained in:
@@ -3594,8 +3594,8 @@ fn handle_readline_command(&mut self, c: ReadlineCmd) {
|
||||
if is_kill {
|
||||
self.delete_char(/*backward*/ false);
|
||||
} else {
|
||||
let (_elt, el) = self.active_edit_line_mut();
|
||||
el.set_position(el.position() + 1);
|
||||
let pos = el.position();
|
||||
self.update_buff_pos(elt, Some(pos + 1));
|
||||
}
|
||||
} else {
|
||||
self.data.move_word(
|
||||
@@ -3607,10 +3607,8 @@ fn handle_readline_command(&mut self, c: ReadlineCmd) {
|
||||
true,
|
||||
);
|
||||
if !is_kill {
|
||||
let (_elt, el) = self.active_edit_line_mut();
|
||||
if el.position() < el.len() {
|
||||
el.set_position(el.position() + 1);
|
||||
}
|
||||
let pos = self.edit_line(elt).position();
|
||||
self.update_buff_pos(elt, Some(pos + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user