Clean up reader history search

Factor the history search fields into a new class.
As a side effect, this shares the deduplication logic, so that token search
no longer returns duplicates.

Fixes #4795
This commit is contained in:
ridiculousfish
2018-08-11 14:30:10 -07:00
parent 1473f952d4
commit e51e854d8d
4 changed files with 240 additions and 249 deletions

View File

@@ -422,11 +422,11 @@ int builtin_commandline(parser_t &parser, io_streams_t &streams, wchar_t **argv)
}
if (search_mode) {
return !reader_search_mode();
return reader_is_in_search_mode() ? 0 : 1;
}
if (paging_mode) {
return !reader_has_pager_contents();
return reader_has_pager_contents() ? 0 : 1;
}
switch (buffer_part) {