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:
ridiculousfish
2018-01-30 09:39:04 -08:00
parent f135c53196
commit d0d7bb75cd
5 changed files with 14 additions and 0 deletions

View File

@@ -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();