mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 10:57:30 +08:00
Make shift-delete also delete current autosuggestion
This is a bit more convenient than using "history delete".
This commit is contained in:
parent
67197b4b07
commit
301e4d497e
|
@ -138,6 +138,7 @@ New or improved bindings
|
||||||
For example, ``commandline -f yank -f yank-pop`` inserts the last-but-one entry from the kill ring.
|
For example, ``commandline -f yank -f yank-pop`` inserts the last-but-one entry from the kill ring.
|
||||||
- When the cursor is on a command that resolves to an executable script, :kbd:`alt-o` will now open that script in your editor (:issue:`10266`).
|
- When the cursor is on a command that resolves to an executable script, :kbd:`alt-o` will now open that script in your editor (:issue:`10266`).
|
||||||
- During up-arrow history search, :kbd:`shift-delete` will delete the current search item and move to the next older item. Previously this was only supported in the history pager.
|
- During up-arrow history search, :kbd:`shift-delete` will delete the current search item and move to the next older item. Previously this was only supported in the history pager.
|
||||||
|
Same for autosuggestions.
|
||||||
- Some improvements to the :kbd:`alt-e` binding which edits the commandline in an external editor:
|
- Some improvements to the :kbd:`alt-e` binding which edits the commandline in an external editor:
|
||||||
- The editor's cursor position is copied back to fish. This is currently supported for Vim and Kakoune.
|
- The editor's cursor position is copied back to fish. This is currently supported for Vim and Kakoune.
|
||||||
- Cursor position synchronization is only supported for a set of known editors. This has been extended by also resolving aliases. For example use ``complete --wraps my-vim vim`` to synchronize cursors when `EDITOR=my-vim`.
|
- Cursor position synchronization is only supported for a set of known editors. This has been extended by also resolving aliases. For example use ``complete --wraps my-vim vim`` to synchronize cursors when `EDITOR=my-vim`.
|
||||||
|
|
|
@ -2579,11 +2579,20 @@ impl ReaderData {
|
||||||
}
|
}
|
||||||
rl::HistoryPagerDelete => {
|
rl::HistoryPagerDelete => {
|
||||||
// Also applies to ordinary history search.
|
// Also applies to ordinary history search.
|
||||||
if !self.history_search.is_at_end() {
|
let is_history_search = !self.history_search.is_at_end();
|
||||||
self.history.remove(self.history_search.current_result());
|
if is_history_search || !self.autosuggestion.is_empty() {
|
||||||
|
self.history.remove(if is_history_search {
|
||||||
|
self.history_search.current_result()
|
||||||
|
} else {
|
||||||
|
&self.autosuggestion.text
|
||||||
|
});
|
||||||
self.history.save();
|
self.history.save();
|
||||||
self.history_search.handle_deletion();
|
if is_history_search {
|
||||||
self.update_command_line_from_history_search();
|
self.history_search.handle_deletion();
|
||||||
|
self.update_command_line_from_history_search();
|
||||||
|
} else {
|
||||||
|
self.autosuggestion.clear();
|
||||||
|
}
|
||||||
self.inputter.function_set_status(true);
|
self.inputter.function_set_status(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user