mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
Make return not execute the selected completion in the pager, instead
just accept it
This commit is contained in:
parent
369229ea71
commit
441522f97b
1 changed files with 11 additions and 1 deletions
12
reader.cpp
12
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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue