Normal text input to disable paging instead of search

Prior to this fix, if the user typed normal characters while the
completion pager was shown, it would begin searching. This feature was
not well liked, so we are going to instead just append the characters as
normal and disable paging. Control-S can be used to toggle the search
field.

Fixes #2249
This commit is contained in:
ridiculousfish 2018-01-30 09:49:46 -08:00
parent c4a12f90c1
commit 5c2e6734c1
2 changed files with 2 additions and 6 deletions

View File

@ -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).
- Typing normal characters while the completion pager is active no longer shows the search field. Instead it enters them into the command line, and ends paging (#2249).
- A new input binding `pager-toggle-search` toggles the search field in the completions pager on and off. By default this is bound to control-s.
## Other significant changes

View File

@ -3195,15 +3195,10 @@ const wchar_t *reader_readline(int nchars) {
// Other, if a normal character, we add it to the command.
if (!fish_reserved_codepoint(c) && (c >= L' ' || c == L'\n' || c == L'\r') &&
c != 0x7F) {
bool allow_expand_abbreviations = false;
if (data->is_navigating_pager_contents()) {
data->pager.set_search_field_shown(true);
} else {
allow_expand_abbreviations = true;
}
// Regular character.
editable_line_t *el = data->active_edit_line();
bool allow_expand_abbreviations = (el == &data->command_line);
insert_char(data->active_edit_line(), c, allow_expand_abbreviations);
// End paging upon inserting into the normal command line.