mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 05:43:11 +00:00
Fix regression of C-e always accepting autosuggestion
This commit is contained in:
parent
8c91d1421a
commit
b687ef036b
2 changed files with 28 additions and 14 deletions
|
@ -2043,21 +2043,27 @@ impl ReaderData {
|
|||
self.update_buff_pos(elt, Some(position - 1));
|
||||
}
|
||||
}
|
||||
rl::EndOfLine => loop {
|
||||
let position = {
|
||||
let (_elt, el) = self.active_edit_line();
|
||||
let position = el.position();
|
||||
if position == el.len() {
|
||||
self.accept_autosuggestion(true, false, MoveWordStyle::Punctuation);
|
||||
break;
|
||||
rl::EndOfLine => {
|
||||
let (_elt, el) = self.active_edit_line();
|
||||
if el.position() == el.len() {
|
||||
self.accept_autosuggestion(true, false, MoveWordStyle::Punctuation);
|
||||
} else {
|
||||
loop {
|
||||
let position = {
|
||||
let (_elt, el) = self.active_edit_line();
|
||||
let position = el.position();
|
||||
if position == el.len() {
|
||||
break;
|
||||
}
|
||||
if el.text().char_at(position) == '\n' {
|
||||
break;
|
||||
}
|
||||
position
|
||||
};
|
||||
self.update_buff_pos(self.active_edit_line_tag(), Some(position + 1));
|
||||
}
|
||||
if el.text().char_at(position) == '\n' {
|
||||
break;
|
||||
}
|
||||
position
|
||||
};
|
||||
self.update_buff_pos(self.active_edit_line_tag(), Some(position + 1));
|
||||
},
|
||||
}
|
||||
}
|
||||
rl::BeginningOfBuffer => {
|
||||
self.update_buff_pos(EditableLineTag::Commandline, Some(0));
|
||||
}
|
||||
|
|
|
@ -94,3 +94,11 @@ isolated-tmux send-keys C-s
|
|||
tmux-sleep
|
||||
isolated-tmux capture-pane -p
|
||||
# CHECK: prompt 7> echo suggest this
|
||||
|
||||
isolated-tmux send-keys C-u
|
||||
isolated-tmux send-keys 'echo sugg' C-a
|
||||
tmux-sleep
|
||||
isolated-tmux send-keys C-e M-f Space nothing
|
||||
tmux-sleep
|
||||
isolated-tmux capture-pane -p
|
||||
# CHECK: prompt 7> echo suggest nothing
|
||||
|
|
Loading…
Reference in a new issue