diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2014-01-27 22:01:38 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2014-01-27 22:01:38 -0800 |
commit | 441522f97bfc80e4c5dd54538437a923619cc124 (patch) | |
tree | a9e30e4e201f8a80638016a404297231f8da8c09 /reader.cpp | |
parent | 369229ea71ef41710ef1ea3a4e39ed8ce08dc778 (diff) |
Make return not execute the selected completion in the pager, instead
just accept it
Diffstat (limited to 'reader.cpp')
-rw-r--r-- | reader.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -1060,7 +1060,6 @@ static bool command_ends_paging(wchar_t c, bool focused_on_search_field) case R_END_OF_HISTORY: case R_HISTORY_TOKEN_SEARCH_BACKWARD: case R_HISTORY_TOKEN_SEARCH_FORWARD: - case R_EXECUTE: case R_ACCEPT_AUTOSUGGESTION: case R_CANCEL: return true; @@ -1077,6 +1076,10 @@ static bool command_ends_paging(wchar_t c, bool focused_on_search_field) case R_SUPPRESS_AUTOSUGGESTION: default: return false; + + /* R_EXECUTE does end paging, but only executes if it was not paging. So it's handled specially */ + case R_EXECUTE: + return false; /* These commands operate on the search field if that's where the focus is */ case R_BEGINNING_OF_LINE: @@ -3532,6 +3535,13 @@ const wchar_t *reader_readline(void) /* Delete any autosuggestion */ data->autosuggestion.clear(); + /* If the user hits return while navigating the pager, it only clears the pager */ + if (data->is_navigating_pager_contents()) + { + clear_pager(); + break; + } + /* We only execute the command line */ editable_line_t *el = &data->command_line; |