aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-01-27 22:01:38 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-01-27 22:01:38 -0800
commit441522f97bfc80e4c5dd54538437a923619cc124 (patch)
treea9e30e4e201f8a80638016a404297231f8da8c09 /reader.cpp
parent369229ea71ef41710ef1ea3a4e39ed8ce08dc778 (diff)
Make return not execute the selected completion in the pager, instead
just accept it
Diffstat (limited to 'reader.cpp')
-rw-r--r--reader.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/reader.cpp b/reader.cpp
index dea58f43..51fb0ab2 100644
--- a/reader.cpp
+++ b/reader.cpp
@@ -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;