Flash if history search found nothing

This makes it clearer that we're at the end.

Fixes #7362.
This commit is contained in:
Fabian Homborg 2020-09-30 17:33:50 +02:00
parent 6d30a9f9e4
commit bbdfe126a7
2 changed files with 5 additions and 0 deletions

View file

@ -124,6 +124,7 @@ Interactive improvements
- ``open`` no longer hangs indefinitely as a bug in ``xdg-open`` has been worked around (#7215).
- Long command lines no longer add a blank line after execution (#6826) and behave better with backspace (#6951).
- ``functions -t`` works as documented (#6985).
- History search now flashes when it found no more results (#7362)
New or improved bindings
^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -3141,6 +3141,10 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
? history_search_direction_t::backward
: history_search_direction_t::forward;
bool found = history_search.move_in_direction(dir);
// Signal that we've found nothing
if (!found) flash();
if (!found && !was_active_before) {
history_search.reset();
break;