From 390772358cedc9ed541a27b3cac1f8d97beef0ef Mon Sep 17 00:00:00 2001 From: bptato Date: Sat, 17 Feb 2024 22:03:07 +0100 Subject: 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. --- src/local/pager.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/local/pager.nim') 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: -- cgit 1.4.1-2-gfad0