mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 10:58:52 +00:00
Fixed bug in escape sequence, showing up with ignore format off (addressing #8380).
This commit is contained in:
parent
612c0a4aaa
commit
927496ecd0
12
development/autotests/findadv-re-04-in.txt
Normal file
12
development/autotests/findadv-re-04-in.txt
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Finding styles with regexp
|
||||||
|
|
||||||
|
Lang it_IT.utf8
|
||||||
|
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
|
||||||
|
KK: Hello \CeHello\C\[Home]
|
||||||
|
KK: \Cs
|
||||||
|
KK: \CF
|
||||||
|
# Uncheck ignore format (depends on IT language)
|
||||||
|
KK: \Az\Ag\Ae
|
||||||
|
KK: \Ce\Axregexp-mode\[Return].*\[Return]
|
||||||
|
TestEnd
|
||||||
|
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 6\n with len: 5' lyx-log.txt
|
@ -492,19 +492,20 @@ Escapes const & get_regexp_escapes()
|
|||||||
{
|
{
|
||||||
static Escapes escape_map;
|
static Escapes escape_map;
|
||||||
if (escape_map.empty()) {
|
if (escape_map.empty()) {
|
||||||
escape_map.push_back(pair<string, string>("$", "\\$"));
|
escape_map.push_back(pair<string, string>("$", "_x_$"));
|
||||||
escape_map.push_back(pair<string, string>("{", "\\{"));
|
escape_map.push_back(pair<string, string>("{", "_x_{"));
|
||||||
escape_map.push_back(pair<string, string>("}", "\\}"));
|
escape_map.push_back(pair<string, string>("}", "_x_}"));
|
||||||
escape_map.push_back(pair<string, string>("[", "\\["));
|
escape_map.push_back(pair<string, string>("[", "_x_["));
|
||||||
escape_map.push_back(pair<string, string>("]", "\\]"));
|
escape_map.push_back(pair<string, string>("]", "_x_]"));
|
||||||
escape_map.push_back(pair<string, string>("(", "\\("));
|
escape_map.push_back(pair<string, string>("(", "_x_("));
|
||||||
escape_map.push_back(pair<string, string>(")", "\\)"));
|
escape_map.push_back(pair<string, string>(")", "_x_)"));
|
||||||
escape_map.push_back(pair<string, string>("+", "\\+"));
|
escape_map.push_back(pair<string, string>("+", "_x_+"));
|
||||||
escape_map.push_back(pair<string, string>("*", "\\*"));
|
escape_map.push_back(pair<string, string>("*", "_x_*"));
|
||||||
escape_map.push_back(pair<string, string>(".", "\\."));
|
escape_map.push_back(pair<string, string>(".", "_x_."));
|
||||||
escape_map.push_back(pair<string, string>("\\", "(?:\\\\|\\\\backslash)"));
|
escape_map.push_back(pair<string, string>("\\", "(?:\\\\|\\\\backslash)"));
|
||||||
escape_map.push_back(pair<string, string>("~", "(?:\\\\textasciitilde|\\\\sim)"));
|
escape_map.push_back(pair<string, string>("~", "(?:\\\\textasciitilde|\\\\sim)"));
|
||||||
escape_map.push_back(pair<string, string>("^", "(?:\\^|\\\\textasciicircum\\{\\}|\\\\mathcircumflex)"));
|
escape_map.push_back(pair<string, string>("^", "(?:\\^|\\\\textasciicircum\\{\\}|\\\\mathcircumflex)"));
|
||||||
|
escape_map.push_back(pair<string, string>("_x_", "\\"));
|
||||||
}
|
}
|
||||||
return escape_map;
|
return escape_map;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user