Make control-S begin navigating the pager contents

In addition to showing the search field, actually allow the user to type in
it.
This commit is contained in:
ridiculousfish
2019-01-22 14:33:47 -08:00
parent 24f251e044
commit 87b7b6b2bb
2 changed files with 7 additions and 1 deletions

View File

@@ -2728,10 +2728,15 @@ const wchar_t *reader_readline(int nchars) {
break;
}
case R_PAGER_TOGGLE_SEARCH: {
if (data->is_navigating_pager_contents()) {
if (!data->pager.empty()) {
// Toggle search, and begin navigating if we are now searching.
bool sfs = data->pager.is_search_field_shown();
data->pager.set_search_field_shown(!sfs);
data->pager.set_fully_disclosed(true);
if (data->pager.is_search_field_shown() &&
!data->is_navigating_pager_contents()) {
select_completion_in_direction(direction_south);
}
reader_repaint_needed();
}
break;