mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-15 22:44:01 +00:00
history search: do not move the cursor after failing backward search
When editing a multiline command line and pressing "up" with the cursor at the first line, fish attempts a hsitory search. If the search fails, don't move the cursor to the end of the multiline command because this can be annoying when the user does not actually want to perform a history search.
This commit is contained in:
parent
8b961a0ca8
commit
971c2eb668
1 changed files with 4 additions and 2 deletions
|
@ -3039,8 +3039,10 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
|
|||
c == rl::history_prefix_search_backward)
|
||||
? history_search_direction_t::backward
|
||||
: history_search_direction_t::forward;
|
||||
history_search.move_in_direction(dir);
|
||||
update_command_line_from_history_search();
|
||||
if (history_search.move_in_direction(dir) ||
|
||||
(dir == history_search_direction_t::forward && history_search.is_at_end())) {
|
||||
update_command_line_from_history_search();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue