]> git.lyx.org Git - features.git/commitdiff
Amend(1) 73188e3.
authorKornel Benko <kornel@lyx.org>
Sat, 29 Sep 2018 16:46:21 +0000 (18:46 +0200)
committerKornel Benko <kornel@lyx.org>
Sat, 29 Sep 2018 16:46:21 +0000 (18:46 +0200)
This is slightly better, but still not satisfying.

Enable format search
Given the latexified string
\emph{Fox jUMps}
and using emphasized regex '\w*', we find 'Fox'. That is OK.
But the next find finds ' ', which is not OK.
In contrast, searching with '\w+', we find the correct string 'jUMps'.

src/lyxfind.cpp

index ffe7df2137af23af4c0cc8ecba1b348b86070b28..879c801b6cc31f67387a94cb47530b8346dc1221 100644 (file)
@@ -934,10 +934,10 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions const &
                        regex_replace(par_as_string, par_as_string, "(.*)\\\\}$", "$1");
                        // save '\.'
                        regex_replace(par_as_string, par_as_string, "\\\\\\.", "_xxbdotxx_");
-                       // handle '.' -> '[^]', replace later as '[^\}]'
+                       // handle '.' -> '[^]', replace later as '[^\}\{\\]'
                        regex_replace(par_as_string, par_as_string, "\\.", "[^]");
-                       // replace '[^...]' with '[^...\}]'
-                       regex_replace(par_as_string, par_as_string, "\\[\\^([^\\\\\\]]*)\\]", "_xxbrlxx_$1\\}_xxbrrxx_");
+                       // replace '[^...]' with '[^...\}\{\\]'
+                       regex_replace(par_as_string, par_as_string, "\\[\\^([^\\\\\\]]*)\\]", "_xxbrlxx_$1\\}\\{\\\\_xxbrrxx_");
                        regex_replace(par_as_string, par_as_string, "_xxbrlxx_", "[^");
                        regex_replace(par_as_string, par_as_string, "_xxbrrxx_", "]");
                        // restore '\.'