mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 05:53:59 +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_END_OF_HISTORY:
|
||||||
case R_HISTORY_TOKEN_SEARCH_BACKWARD:
|
case R_HISTORY_TOKEN_SEARCH_BACKWARD:
|
||||||
case R_HISTORY_TOKEN_SEARCH_FORWARD:
|
case R_HISTORY_TOKEN_SEARCH_FORWARD:
|
||||||
case R_EXECUTE:
|
|
||||||
case R_ACCEPT_AUTOSUGGESTION:
|
case R_ACCEPT_AUTOSUGGESTION:
|
||||||
case R_CANCEL:
|
case R_CANCEL:
|
||||||
return true;
|
return true;
|
||||||
|
@ -1078,6 +1077,10 @@ static bool command_ends_paging(wchar_t c, bool focused_on_search_field)
|
||||||
default:
|
default:
|
||||||
return false;
|
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 */
|
/* These commands operate on the search field if that's where the focus is */
|
||||||
case R_BEGINNING_OF_LINE:
|
case R_BEGINNING_OF_LINE:
|
||||||
case R_END_OF_LINE:
|
case R_END_OF_LINE:
|
||||||
|
@ -3532,6 +3535,13 @@ const wchar_t *reader_readline(void)
|
||||||
/* Delete any autosuggestion */
|
/* Delete any autosuggestion */
|
||||||
data->autosuggestion.clear();
|
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 */
|
/* We only execute the command line */
|
||||||
editable_line_t *el = &data->command_line;
|
editable_line_t *el = &data->command_line;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue