mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 18:53:44 +08:00
Add new pager-toggle-search input function
This adds a new input binding pager-toggle-search which toggles the search field on and off when the pager is showing.
This commit is contained in:
parent
f135c53196
commit
d0d7bb75cd
|
@ -33,6 +33,7 @@ This section is for changes merged to the `major` branch that are not also merge
|
|||
- `funced` now has a `-s` and `--save` option to automatically save the edited function after successfully editing (#4668).
|
||||
- Arguments to `end` are now errors, instead of being silently ignored.
|
||||
- Pager navigation has been improved. Most notably, moving down now wraps around, moving up from the commandline now jumps to the last element and moving right and left now reverse each other even when wrapping around (#4680).
|
||||
- A new input binding `pager-toggle-search` toggles the search field in the completions pager on and off.
|
||||
|
||||
## Other significant changes
|
||||
- Command substitution output is now limited to 10 MB by default (#3822).
|
||||
|
|
|
@ -120,6 +120,8 @@ The following special input functions are available:
|
|||
|
||||
- `kill-word`, move the next word to the killring
|
||||
|
||||
- `pager-toggle-search`, toggles the search field if the completions pager is visible.
|
||||
|
||||
- `suppress-autosuggestion`, remove the current autosuggestion
|
||||
|
||||
- `swap-selection-start-stop`, go to the other end of the highlighted text without changing the selection
|
||||
|
|
|
@ -84,6 +84,7 @@ static const input_function_metadata_t input_function_metadata[] = {
|
|||
{R_YANK_POP, L"yank-pop"},
|
||||
{R_COMPLETE, L"complete"},
|
||||
{R_COMPLETE_AND_SEARCH, L"complete-and-search"},
|
||||
{R_PAGER_TOGGLE_SEARCH, L"pager-toggle-search"},
|
||||
{R_BEGINNING_OF_HISTORY, L"beginning-of-history"},
|
||||
{R_END_OF_HISTORY, L"end-of-history"},
|
||||
{R_BACKWARD_KILL_LINE, L"backward-kill-line"},
|
||||
|
|
|
@ -32,6 +32,7 @@ enum {
|
|||
R_YANK_POP,
|
||||
R_COMPLETE,
|
||||
R_COMPLETE_AND_SEARCH,
|
||||
R_PAGER_TOGGLE_SEARCH,
|
||||
R_BEGINNING_OF_HISTORY,
|
||||
R_END_OF_HISTORY,
|
||||
R_BACKWARD_KILL_LINE,
|
||||
|
|
|
@ -2591,6 +2591,15 @@ const wchar_t *reader_readline(int nchars) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case R_PAGER_TOGGLE_SEARCH: {
|
||||
if (data->is_navigating_pager_contents()) {
|
||||
bool sfs = data->pager.is_search_field_shown();
|
||||
data->pager.set_search_field_shown(!sfs);
|
||||
data->pager.set_fully_disclosed(true);
|
||||
reader_repaint_needed();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case R_KILL_LINE: {
|
||||
editable_line_t *el = data->active_edit_line();
|
||||
const wchar_t *buff = el->text.c_str();
|
||||
|
|
Loading…
Reference in New Issue
Block a user