diff options
author | Daniel Lange <DLange@git.local> | 2020-12-23 18:59:51 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2020-12-25 11:53:02 +0100 |
commit | 8b83a9f0553b317f06e289138cd9e318f6bddf30 (patch) | |
tree | cea16ac72ca835239c2f253dd87f10b0786cad8b /IncSet.c | |
parent | 1cc3f8074f710dbd30e82cdb3e558106535e51d1 (diff) |
Enable going back to previous search matches (Shift-F3)
Diffstat (limited to 'IncSet.c')
-rw-r--r-- | IncSet.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -29,9 +29,9 @@ void IncSet_reset(IncSet* this, IncType type) { IncMode_reset(&this->modes[type]); } -static const char* const searchFunctions[] = {"Next ", "Cancel ", " Search: ", NULL}; -static const char* const searchKeys[] = {"F3", "Esc", " "}; -static const int searchEvents[] = {KEY_F(3), 27, ERR}; +static const char* const searchFunctions[] = {"Next ", "Prev ", "Cancel ", " Search: ", NULL}; +static const char* const searchKeys[] = {"F3", "S-F3", "Esc", " "}; +static const int searchEvents[] = {KEY_F(3), KEY_F(15), 27, ERR}; static inline void IncMode_initSearch(IncMode* search) { memset(search, 0, sizeof(IncMode)); @@ -141,11 +141,11 @@ bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue int size = Panel_size(panel); bool filterChanged = false; bool doSearch = true; - if (ch == KEY_F(3)) { + if (ch == KEY_F(3) || ch == KEY_F(15)) { if (size == 0) return true; - IncMode_find(mode, panel, getPanelValue, 1); + IncMode_find(mode, panel, getPanelValue, ch == KEY_F(3) ? 1 : -1); doSearch = false; } else if (0 < ch && ch < 255 && isprint((unsigned char)ch)) { if (mode->index < INCMODE_MAX) { |