]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfind.cpp
FindAdv: Simplify search for chars '&', '%', '#' and '_'
[lyx.git] / src / lyxfind.cpp
index 378b1c1d0203a2766f423da437d6863e4b74ea88..36ed47bd2ab97a3a2eb8fdedb1aad22f30e5858d 100644 (file)
@@ -1442,8 +1442,16 @@ void LatexInfo::buildEntries(bool isPatternString)
     if (key == "") {
       if (sub.str(0)[0] == '\\')
         key = sub.str(0)[1];
-      else
+      else {
         key = sub.str(0);
+        if (key == "$") {
+          size_t k_pos = sub.position(size_t(0));
+          if ((k_pos > 0) && (interval.par[k_pos - 1] == '\\')) {
+            // Escaped '$', ignoring
+            continue;
+          }
+        }
+      }
     };
     if (evaluatingRegexp) {
       if (sub.str(1).compare("endregexp") == 0) {