From 5c2e6734c1e547da172b3fe0615e070ba84451e3 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Tue, 30 Jan 2018 09:49:46 -0800 Subject: [PATCH] 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 --- CHANGELOG.md | 1 + src/reader.cpp | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c13ba458a..06cd51b3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/reader.cpp b/src/reader.cpp index a8b5282f3..7ac94394c 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -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.