diff options
author | bptato <nincsnevem662@gmail.com> | 2024-02-17 22:03:07 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-02-17 22:07:11 +0100 |
commit | 390772358cedc9ed541a27b3cac1f8d97beef0ef (patch) | |
tree | 621e56ad7b1b4957b1ba686a8902381ce270619c /src/local/pager.nim | |
parent | e98d0ad1dc51050eb17120f835847d55950c2a0b (diff) | |
download | chawan-390772358cedc9ed541a27b3cac1f8d97beef0ef.tar.gz |
regex: re-work compileSearchRegex
I've gotten tired of not being able to search for forward slashes. Now it works like in vim, and you can also set default ignore case in the config.
Diffstat (limited to 'src/local/pager.nim')
-rw-r--r-- | src/local/pager.nim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/local/pager.nim b/src/local/pager.nim index aa546082..d30a0dbc 100644 --- a/src/local/pager.nim +++ b/src/local/pager.nim @@ -807,7 +807,8 @@ proc updateReadLineISearch(pager: Pager, linemode: LineMode) = pager.isearchpromise = nil of EDIT: if lineedit.news != "": - pager.iregex = compileSearchRegex(lineedit.news) + pager.iregex = compileSearchRegex(lineedit.news, + pager.config.search.default_flags) pager.container.popCursorPos(true) pager.container.pushCursorPos() if pager.iregex.isSome: @@ -857,7 +858,8 @@ proc updateReadLine*(pager: Pager) = of BUFFER: pager.container.readSuccess(lineedit.news) of SEARCH_F, SEARCH_B: if lineedit.news != "": - pager.regex = pager.checkRegex(compileSearchRegex(lineedit.news)) + pager.regex = pager.checkRegex(compileSearchRegex(lineedit.news, + pager.config.search.default_flags)) pager.reverseSearch = pager.linemode == SEARCH_B pager.searchNext() of GOTO_LINE: |