From: Kornel Benko Date: Sat, 16 Mar 2019 10:26:20 +0000 (+0100) Subject: FindAdv: Correct start of search if not using regex X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=76552022de060b2967ac621e78d13dbe489771d4;p=features.git FindAdv: Correct start of search if not using regex Do not try to find pattern inside the leading string. --- diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index a6c9f4dd76..90d4ca5c21 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -2923,7 +2923,8 @@ MatchResult MatchStringAdv::findAux(DocIterator const & cur, int len, bool at_be return mres; } } else { - size_t pos = str.find(par_as_string_nolead); + // Start the search _after_ the leading part + size_t pos = str.find(par_as_string_nolead, lead_as_string.size()); if (pos != string::npos) { mres.match_len = par_as_string.size(); mres.match2end = str.size() - pos;