mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +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));
|
self.update_buff_pos(elt, Some(position - 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rl::EndOfLine => loop {
|
rl::EndOfLine => {
|
||||||
let position = {
|
let (_elt, el) = self.active_edit_line();
|
||||||
let (_elt, el) = self.active_edit_line();
|
if el.position() == el.len() {
|
||||||
let position = el.position();
|
self.accept_autosuggestion(true, false, MoveWordStyle::Punctuation);
|
||||||
if position == el.len() {
|
} else {
|
||||||
self.accept_autosuggestion(true, false, MoveWordStyle::Punctuation);
|
loop {
|
||||||
break;
|
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 => {
|
rl::BeginningOfBuffer => {
|
||||||
self.update_buff_pos(EditableLineTag::Commandline, Some(0));
|
self.update_buff_pos(EditableLineTag::Commandline, Some(0));
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,3 +94,11 @@ isolated-tmux send-keys C-s
|
||||||
tmux-sleep
|
tmux-sleep
|
||||||
isolated-tmux capture-pane -p
|
isolated-tmux capture-pane -p
|
||||||
# CHECK: prompt 7> echo suggest this
|
# 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