mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-26 16:01:15 -03:00
end-of-buffer: accept autosuggestion if already at ned
This commit is contained in:
@@ -215,7 +215,8 @@ The following special input functions are available:
|
||||
make the current word lowercase
|
||||
|
||||
``end-of-buffer``
|
||||
moves to the end of the buffer, i.e. the end of the first line
|
||||
moves to the end of the buffer, i.e. the end of the last line;
|
||||
or if already at the end of the commandline, accept the current autosuggestion.
|
||||
|
||||
``end-of-history``
|
||||
move to the end of the history
|
||||
|
||||
@@ -2859,8 +2859,14 @@ fn handle_readline_command(&mut self, c: ReadlineCmd) {
|
||||
.update_buff_pos(EditableLineTag::Commandline, Some(0));
|
||||
}
|
||||
rl::EndOfBuffer => {
|
||||
self.data
|
||||
.update_buff_pos(EditableLineTag::Commandline, Some(self.command_line_len()));
|
||||
if self.is_at_autosuggestion() {
|
||||
self.accept_autosuggestion(AutosuggestionPortion::Count(usize::MAX));
|
||||
} else {
|
||||
self.data.update_buff_pos(
|
||||
EditableLineTag::Commandline,
|
||||
Some(self.command_line_len()),
|
||||
);
|
||||
}
|
||||
}
|
||||
rl::CancelCommandline | rl::ClearCommandline => {
|
||||
if self.conf.exit_on_interrupt {
|
||||
|
||||
Reference in New Issue
Block a user