Fix project search error incorrectly counting the result line number when searching with the wholeword flag.

A couple of minor fixes.
This commit is contained in:
Martín Lucas Golini
2024-03-13 20:14:41 -03:00
parent b7a754a3c8
commit 6db1e5ec43
3 changed files with 18 additions and 12 deletions

View File

@@ -64,6 +64,7 @@ searchInFileHorspool( const std::string& file, const std::string& text, const bo
searchRes = String::BMH::find( fileText, text, searchRes, occ );
if ( searchRes != -1 ) {
if ( wholeWord && !String::isWholeWord( fileText, text, searchRes ) ) {
totNl += countNewLines( fileText, lSearchRes, searchRes );
lSearchRes = searchRes;
searchRes += text.size();
continue;