diff options
author | Daniel Lange <DLange@git.local> | 2022-03-25 16:24:24 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2022-03-25 17:19:59 +0100 |
commit | 7c43e02591de9b6e14744e3eaffed25ad092756e (patch) | |
tree | 31434fb6a9d4f658c1812d9298a4424cab34ffb9 /IncSet.c | |
parent | a2ca7583a9ba2e57eb9e9316aad52c9248aae092 (diff) |
Improve String_contains_i to allow for multiple terms
This enables:
* Multiple filters in the main panel and strace etc. views
* Multiple search terms
The search terms are separated by "|" and are still fixed strings
matched case-insensitive.
Added a multi flag at request of BenBE.
Diffstat (limited to 'IncSet.c')
-rw-r--r-- | IncSet.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -85,7 +85,7 @@ static void updateWeakPanel(const IncSet* this, Panel* panel, Vector* lines) { const char* incFilter = this->modes[INC_FILTER].buffer; for (int i = 0; i < Vector_size(lines); i++) { ListItem* line = (ListItem*)Vector_get(lines, i); - if (String_contains_i(line->value, incFilter)) { + if (String_contains_i(line->value, incFilter, true)) { Panel_add(panel, (Object*)line); if (selected == (Object*)line) { Panel_setSelected(panel, n); @@ -108,7 +108,7 @@ static void updateWeakPanel(const IncSet* this, Panel* panel, Vector* lines) { static bool search(const IncSet* this, Panel* panel, IncMode_GetPanelValue getPanelValue) { int size = Panel_size(panel); for (int i = 0; i < size; i++) { - if (String_contains_i(getPanelValue(panel, i), this->active->buffer)) { + if (String_contains_i(getPanelValue(panel, i), this->active->buffer, true)) { Panel_setSelected(panel, i); return true; } @@ -148,7 +148,7 @@ static bool IncMode_find(const IncMode* mode, Panel* panel, IncMode_GetPanelValu return false; } - if (String_contains_i(getPanelValue(panel, i), mode->buffer)) { + if (String_contains_i(getPanelValue(panel, i), mode->buffer, true)) { Panel_setSelected(panel, i); return true; } |