mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
FindAdv: Correct some testcases
This commit is contained in:
parent
03ad03320e
commit
8028dce129
@ -3,13 +3,14 @@
|
||||
Lang sk_SK.utf8
|
||||
CO: findadv-05.ctrl
|
||||
TestBegin test.lyx -dbg key,find > findadv-05.loga.txt 2>&1
|
||||
KD: 50
|
||||
KD: 100
|
||||
CN: Part 1
|
||||
KK: foo \Cefoo foo\Ce foo\C\[Home]
|
||||
KK: \Cs
|
||||
KK: \CF
|
||||
# Uncheck ignore format
|
||||
KK: \At\Ai\Ah
|
||||
KK: \CF
|
||||
# Select emphasised
|
||||
KK: \Ce
|
||||
KK: foo\[Return]
|
||||
|
@ -14,6 +14,7 @@ KK: \Axbuffer-write\[Return]
|
||||
KK: \Axdialog-show findreplaceadv\[Return]
|
||||
# Uncheck ignore format
|
||||
KK: \At\Ai\Ah
|
||||
KK: \CF
|
||||
KK: \Aj
|
||||
KK: \Ao2
|
||||
KK: foo\[Return]
|
||||
@ -26,9 +27,11 @@ KK: \Axdialog-show findreplaceadv\[Return]
|
||||
KK: \[Delete]
|
||||
# Uncheck ignore format
|
||||
#KK: \At\Ai\Ah
|
||||
#KK: \CF
|
||||
KK: \Ao9
|
||||
KK: foo\[Return]\[Return]
|
||||
KK: foo\[Return]\[Return]\[Return]
|
||||
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n with len: 3
|
||||
CP: Putting selection at .*idx: 0 par: 1 pos: 0\n with len: 3
|
||||
CP: Putting selection at .*idx: 0 par: 2 pos: 0\n with len: 3
|
||||
TestEnd
|
||||
Lang C
|
||||
|
@ -15,6 +15,7 @@ KK: \Axbuffer-write\[Return]
|
||||
KK: \Axdialog-show findreplaceadv\[Return]
|
||||
# Uncheck ignore format
|
||||
KK: \At\Ai\Ah
|
||||
KK: \CF
|
||||
KK: \Aob
|
||||
Sleep 1
|
||||
KK: foo\[Return]
|
||||
@ -27,6 +28,7 @@ KK: \CF
|
||||
KK: \[Delete]
|
||||
# Uncheck ignore format
|
||||
#KK: \At\Ai\Ah
|
||||
#KK: \CF
|
||||
KK: \Aob
|
||||
Sleep 1
|
||||
KK: bar\[Return]
|
||||
|
@ -9,6 +9,7 @@ KK: one\[Return]two\[Return]three\C\[Home]\Cs
|
||||
KK: \CF
|
||||
# Uncheck ignore format
|
||||
KK: \At\Ai\Ah
|
||||
KK: \CF
|
||||
KK: \Aob
|
||||
KK: \Axregexp-mode\[Return][a-z]* \[Return]
|
||||
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n with len: 3
|
||||
@ -20,6 +21,7 @@ KK: \CF
|
||||
KK: \[Delete]
|
||||
# Uncheck ignore format
|
||||
#KK: \At\Ai\Ah
|
||||
#KK: \CF
|
||||
KK: \Aob
|
||||
KK: \Axregexp-mode\[Return][a-z]* \[Return]\[Return]
|
||||
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n with len: 3
|
||||
|
@ -11,6 +11,7 @@ KK: \Cs
|
||||
KK: \CF
|
||||
# Uncheck ignore format (depends on IT language)
|
||||
KK: \At\Ai\Ah
|
||||
KK: \CF
|
||||
KK: LyX\[Return]
|
||||
CP: Putting selection at .*idx: 0 par: 0 pos: 8\n with len: 3
|
||||
#
|
||||
@ -21,6 +22,7 @@ KK: \CF
|
||||
KK: \[Delete]
|
||||
# Uncheck ignore format
|
||||
#KK: \At\Ai\Ah
|
||||
#KK: \CF
|
||||
KK: LaTeX\[Return]
|
||||
CP: Putting selection at .*idx: 0 par: 1 pos: 10\n with len: 5
|
||||
TestEnd
|
||||
|
@ -21,6 +21,7 @@ KK: \CF
|
||||
KK: \[Delete]
|
||||
# Uncheck ignore format
|
||||
KK: \Az\Ag\Ae
|
||||
KK: \CF
|
||||
KK: \Cm
|
||||
KK: v\[Return]
|
||||
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n.*idx: 1 par: 0 pos: 0\n with len: 1
|
||||
|
@ -12,6 +12,7 @@ KK: \Cs
|
||||
KK: \CF
|
||||
# Uncheck ignore format
|
||||
KK: \At\Ai\Ah
|
||||
KK: \CF
|
||||
KK: \Amd
|
||||
KK: x^2\[Return]
|
||||
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n with len: 1
|
||||
@ -33,6 +34,7 @@ CP: Key (queried) [action=buffer-begin][Ctrl+Home]
|
||||
KK: \CF
|
||||
KK: \[Delete]
|
||||
KK: \At\Ai\Ah
|
||||
KK: \CF
|
||||
KK: \Amd
|
||||
KK: x^2\[Return]
|
||||
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n with len: 1
|
||||
|
@ -13,6 +13,7 @@ KK: \Cs
|
||||
KK: \CF
|
||||
# Uncheck ignore format
|
||||
KK: \At\Ai\Ah
|
||||
KK: \CF
|
||||
KK: \C\[F22]
|
||||
KK: x^2\[Return]
|
||||
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n with len: 1
|
||||
@ -35,6 +36,7 @@ KK: \CF
|
||||
KK: \[Delete]
|
||||
# Check ignore format (was unchecked)
|
||||
KK: \At\Ai\Ah
|
||||
KK: \CF
|
||||
KK: \C\[F22]
|
||||
KK: x^2\[Return]
|
||||
CP: Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n with len: 1
|
||||
|
@ -1,6 +1,7 @@
|
||||
# Finding special latex/regexp chars: (
|
||||
#
|
||||
Lang it_IT.utf8
|
||||
KD: 100
|
||||
CO: findadv-re-01.ctrl
|
||||
TestBegin test.lyx -dbg key,find > findadv-re-01.loga.txt 2>&1
|
||||
CN: Part 1
|
||||
@ -18,6 +19,7 @@ CN: Part 2
|
||||
KK: \CF
|
||||
# Uncheck ignore format
|
||||
KK: \At\Ai\Ah
|
||||
KK: \CF
|
||||
KK: \Axregexp-mode\[Return]\\(\[Return]
|
||||
CP: Putting selection at .*idx: 0 par: 0 pos: 1\n with len: 1
|
||||
TestEnd
|
||||
@ -40,6 +42,7 @@ CN: Part 4
|
||||
KK: \CF
|
||||
# Uncheck ignore format
|
||||
KK: \At\Ai\Ah
|
||||
KK: \CF
|
||||
KK: \Axregexp-mode\[Return]\\[\[Return]
|
||||
CP: Putting selection at .*idx: 0 par: 0 pos: 3\n with len: 1
|
||||
TestEnd
|
||||
|
@ -968,7 +968,7 @@ static size_t identifyLeading(string const & s)
|
||||
// + allow to search for colored text too
|
||||
while (regex_replace(t, t, REGEX_BOS "\\\\(((footnotesize|tiny|scriptsize|small|large|Large|LARGE|huge|Huge|emph|noun|minisec|text(bf|md|sl|sf|it|tt))|((textcolor|foreignlanguage|latexenvironment)\\{[a-z]+\\*?\\})|(u|uu)line|(s|x)out|uwave)|((sub)?(((sub)?section)|paragraph)|part|chapter)\\*?)\\{", "")
|
||||
|| regex_replace(t, t, REGEX_BOS "\\$", "")
|
||||
|| regex_replace(t, t, REGEX_BOS "\\\\\\[ ", "")
|
||||
|| regex_replace(t, t, REGEX_BOS "\\\\\\[", "")
|
||||
|| regex_replace(t, t, REGEX_BOS " ?\\\\item\\{[a-z]+\\}", "")
|
||||
|| regex_replace(t, t, REGEX_BOS "\\\\begin\\{[a-zA-Z_]*\\*?\\} ", ""))
|
||||
;
|
||||
@ -2711,7 +2711,7 @@ static int identifyClosing(string & t)
|
||||
LYXERR(Debug::FIND, "identifyClosing(): t now is '" << t << "'");
|
||||
if (regex_replace(t, t, "(.*[^\\\\])\\$" REGEX_EOS, "$1"))
|
||||
continue;
|
||||
if (regex_replace(t, t, "(.*[^\\\\]) \\\\\\]" REGEX_EOS, "$1"))
|
||||
if (regex_replace(t, t, "(.*[^\\\\])\\\\\\]" REGEX_EOS, "$1"))
|
||||
continue;
|
||||
if (regex_replace(t, t, "(.*[^\\\\]) \\\\end\\{[a-zA-Z_]*\\*?\\}" REGEX_EOS, "$1"))
|
||||
continue;
|
||||
@ -3040,9 +3040,14 @@ MatchResult MatchStringAdv::operator()(DocIterator const & cur, int len, bool at
|
||||
bool ws_left = (cur.pos() > 0)
|
||||
? par.isWordSeparator(cur.pos() - 1)
|
||||
: true;
|
||||
bool ws_right = (cur.pos() + len < par.size())
|
||||
bool ws_right;
|
||||
if (len < 0)
|
||||
ws_right = true;
|
||||
else {
|
||||
ws_right = (cur.pos() + len < par.size())
|
||||
? par.isWordSeparator(cur.pos() + len)
|
||||
: true;
|
||||
}
|
||||
LYXERR(Debug::FIND,
|
||||
"cur.pos()=" << cur.pos() << ", res=" << res
|
||||
<< ", separ: " << ws_left << ", " << ws_right
|
||||
|
Loading…
Reference in New Issue
Block a user