mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
FindAdv: Don't check on '\\\\\n' if ignoring format
Since it can only happen if the lyx source contains two backslasches before the inserted newline. And here it is the wrong case.
This commit is contained in:
parent
b0323628af
commit
115d6ceedd
@ -4000,22 +4000,19 @@ static string convertLF2Space(docstring const &s, bool ignore_format)
|
|||||||
t << lyx::to_utf8(s.substr(start, end + 1 - start));
|
t << lyx::to_utf8(s.substr(start, end + 1 - start));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((pos > start+2) &&
|
if (!ignore_format) {
|
||||||
|
if ((pos > start + 1) &&
|
||||||
s[pos-1] == '\\' &&
|
s[pos-1] == '\\' &&
|
||||||
s[pos-2] == '\\') {
|
s[pos-2] == '\\') {
|
||||||
if (s[pos-1] == '\\' && s[pos-2] == '\\') {
|
|
||||||
skip = 2;
|
skip = 2;
|
||||||
if ((pos > start+3) &&
|
if ((pos > start + 2) &&
|
||||||
(s[pos+1] == '~' || isSpace(s[pos+1]) ||
|
(s[pos+1] == '~' || isSpace(s[pos+1]) ||
|
||||||
s[pos-3] == '~' || isSpace(s[pos-3]))) {
|
s[pos-3] == '~' || isSpace(s[pos-3]))) {
|
||||||
// discard '\n'
|
// discard '\n'
|
||||||
dospace = false;
|
dospace = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (s[pos-1] == '\\' && s[pos-2] == '\\')
|
else if ((pos > start) &&
|
||||||
skip = 2;
|
|
||||||
}
|
|
||||||
else if (!ignore_format && (pos > start) &&
|
|
||||||
s[pos-1] == '%') {
|
s[pos-1] == '%') {
|
||||||
skip = 1;
|
skip = 1;
|
||||||
while ((pos > start+skip) && (s[pos-1-skip] == '%'))
|
while ((pos > start+skip) && (s[pos-1-skip] == '%'))
|
||||||
@ -4027,6 +4024,7 @@ static string convertLF2Space(docstring const &s, bool ignore_format)
|
|||||||
dospace = false;
|
dospace = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
dospace = true;
|
dospace = true;
|
||||||
skip = 0;
|
skip = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user