diff options
author | ache <ache@ache.one> | 2019-01-24 08:52:54 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2019-01-24 08:52:54 +0100 |
commit | e63da80cd14701d1df6423480dab4b4c7c2c8a23 (patch) | |
tree | 379c820b4ba33b55b70306797e7d1522bdff2f58 /regex.c | |
parent | Edit instead of remplace (diff) |
Search by filename
Diffstat (limited to 'regex.c')
-rw-r--r-- | regex.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -117,6 +117,20 @@ void regexSelection(menuC* menu, const char* msg) { } } } +void regexSearch(menuC* menu, const char* msg) { + for(int i = menu->hl + 1 ; i < menu->nbElem ; i++ ) { + if( match_regex(msg, menu->list[i].cstr, NULL, -1 ) ) { + menu->hl = i; + return; + } + } + for(int i = 0 ; i < menu->hl ; i++ ) { + if( match_regex(msg, menu->list[i].cstr, NULL, -1 ) ) { + menu->hl = i; + return; + } + } +} void regexXtracts(menuC* menu, const char* msg) { int hasSelect = 0; for(int i = 0 ; i < menu->nbElem ; i++ ) { |