]> git.lyx.org Git - features.git/commitdiff
Findadv: Remaining findadv tests pass now
authorKornel Benko <kornel@lyx.org>
Mon, 29 Oct 2018 12:17:54 +0000 (13:17 +0100)
committerKornel Benko <kornel@lyx.org>
Mon, 29 Oct 2018 12:17:54 +0000 (13:17 +0100)
Exception: findadv-21, but it is not a regression,
because this one never passed.
The problem here is, that we cannot differentiate
between enumeration, itemize, description and labeling
environment here.

development/autotests/findadv-combined-in.txt
development/autotests/findadv-re-03-in.txt
development/autotests/findadv-re-06-in.txt
src/lyxfind.cpp

index 6489e2d9fda4b0d003f4057b9b8704ac74c38923..c273a136f87130998435ee8105870a0b31562e17 100644 (file)
@@ -8,6 +8,7 @@ CO: findadv-combined.ctrl
 TestBegin test.lyx -dbg key,find > findadv-combined.loga.txt 2>&1
 CP: Key (queried) [action=buffer-begin][Ctrl+Home]
 # String to be checked
+KD: 100
 KK: \\()[]{}%^#@?*.\[Return]
 KK: \\()[]{}%^#@?*.\[Return]
 KK: \\()[]{}%^#@?*.\[Return]
@@ -29,32 +30,37 @@ KK: \[Escape]\C\[Home]
 CP: Key (queried) [action=buffer-begin][Ctrl+Home]
 CN: Part 001
 KK: \C\[F21]\C\[F20]\\@\[Return]
-CP: Escaped : '\@'
+Sleep 1
+CN: Escaped : '\@'
 CR: [pP]utting selection at .*idx: 0 par: 0 pos: 10\n with len: 1
 #
 CN: Part 002
 KK: \C\[F21]\C\[F20]\\(\[Return]
-CP: Escaped : '\('
+Sleep 1
+CN: Escaped : '\('
 CP: Putting selection at .*idx: 0 par: 1 pos: 1\n with len: 1
 #
 CN: Part 003
 KK: \C\[F21]\C\[F20]\\)\[Return]
-CP: Escaped : '\)'
+Sleep 1
+CN: Escaped : '\)'
 CP: Putting selection at .*idx: 0 par: 1 pos: 2\n with len: 1
 #
 CN: Part 004
 KK: \C\[F21]\C\[F20]\\\\\[Return]
-CP: Escaping: '\backslash\backslash'
+Sleep 1
+CN: Escaping: '\backslash\backslash'
 CP: Putting selection at .*idx: 0 par: 2 pos: 0\n with len: 1
 #
 CN: Part 005
 KK: \C\[F21]\C\[F20]%\[Return]
-CP: Escaped : '%'
+CN: Escaped : '%'
 CP: Putting selection at .*idx: 0 par: 2 pos: 7\n with len: 1
 #
 CN: Part 006
 KK: \C\[F21]\C\[F20]\\^\[Return]
-CP: Escaped : '\^'
+Sleep 1
+CN: Escaped : '\^'
 CP: Putting selection at .*idx: 0 par: 2 pos: 8\n with len: 1
 #
 CN: Part 007
@@ -64,17 +70,19 @@ CP: Putting selection at .*idx: 0 par: 3 pos: 3\n with len: 1
 #
 CN: Part 008
 KK: \C\[F21]\C\[F20]\\]\[Return]
-CP: Escaped : '\]'
+Sleep 1
+CN: Escaped : '\]'
 CP: Putting selection at .*idx: 0 par: 3 pos: 4\n with len: 1
 #
 CN: Part 009
 KK: \C\[F21]\C\[F20]\\{\[Return]
-CP: Escaping: '\backslash\{'
+CN: Escaping: '\backslash\{'
 CP: Putting selection at .*idx: 0 par: 3 pos: 5\n with len: 1
 #
 CN: Part 010
 KK: \C\[F21]\C\[F20]\\}\[Return]
-CP: Escaping: '\backslash\}'
+Sleep 1
+CN: Escaping: '\backslash\}'
 CP: Putting selection at .*idx: 0 par: 3 pos: 6\n with len: 1
 
 
@@ -86,13 +94,16 @@ CN: ..
 KK: \CF
 # Uncheck ignore format
 KK: \At\Ai\Ah
+Sleep 1
 KK: \[Escape]\C\[Home]
+Sleep 1
 CP: Key (queried) [action=buffer-begin][Ctrl+Home]
 
 #
 CN: Part 101
 KK: \C\[F21]\C\[F20]\\[\[Return]
-CP: Escaped : '\['
+Sleep 1
+CN: Escaped : '\['
 CP: Putting selection at .*idx: 0 par: 0 pos: 3\n with len: 1
 #
 CN: Part 102
index 794069d1802a29d9e47a986554bc6407830a01da..9718467dbf326ccb470b6759be0bf96ec24658ee 100644 (file)
@@ -42,6 +42,7 @@ KK: \CF
 KK: \At\Ai\Ah
 KK: \Axregexp-mode\[Return]\\}\[Return]
 CP: Putting selection at .*idx: 0 par: 0 pos: 6\n with len: 1
+Sleep 1
 TestEnd
 Lang C
 Assert searchPatterns.pl base=findadv-re-03
index d500163d70bf02f025fba902f9d7de7ad5fd7540..dd22409520b389ad12810da2c32298c9f2a1d132 100644 (file)
@@ -3,6 +3,7 @@
 Lang sk_SK.utf8
 CO: findadv-re-06.ctrl
 TestBegin test.lyx -dbg key,find > findadv-re-06.loga.txt 2>&1
+KD: 50
 KK: \Cm\\frac 1-x\[Down]1+x^2 \C\[Home]
 KK: \CF
 # Uncheck ignore format (depends on IT language)
index b3eedec7e470695de7fa42fc2f81c11966baed45..d2b6f1f317c930398537a255fa6dc06f45907848 100644 (file)
@@ -1289,6 +1289,7 @@ void LatexInfo::buildEntries(bool isPatternString)
   static bool disableLanguageOverride = false;
   smatch sub, submath;
   bool evaluatingRegexp = false;
+  bool evaluatingMath = false;
   KeyInfo found;
   bool math_end_waiting = false;
   size_t math_pos = 10000;
@@ -1373,6 +1374,11 @@ void LatexInfo::buildEntries(bool isPatternString)
       }
     }
     else {
+      if (evaluatingMath) {
+        if (sub.position(size_t(0)) < math_end_pos)
+          continue;
+        evaluatingMath = false;
+      }
       if (keys.find(key) == keys.end()) {
         LYXERR(Debug::FIND, "Found unknown key " << sub.str(0));
         continue;
@@ -1397,6 +1403,7 @@ void LatexInfo::buildEntries(bool isPatternString)
         found._dataStart = found._dataEnd;
         found.parenthesiscount = 0;
         math_end_pos = found._dataEnd;
+        evaluatingMath = true;
       }
       else
         continue;