[Pager] Make up without selected contents jump back into the pager

This makes it possible to select the last element of the completions
with just one keypress.

Fixes #3115.
This commit is contained in:
Fabian Homborg
2018-01-23 10:45:30 +01:00
parent 13079911bc
commit dc95bfc1b1
2 changed files with 6 additions and 5 deletions

View File

@@ -2970,9 +2970,9 @@ const wchar_t *reader_readline(int nchars) {
// Now do the selection.
select_completion_in_direction(direction);
} else if (c == R_DOWN_LINE && !data->pager.empty()) {
// We pressed down with a non-empty pager contents, begin navigation.
select_completion_in_direction(direction_south);
} else if (!data->pager.empty()) {
// We pressed a direction with a non-empty pager, begin navigation.
select_completion_in_direction(c == R_DOWN_LINE ? direction_south : direction_north);
} else {
// Not navigating the pager contents.
editable_line_t *el = data->active_edit_line();