mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
FindAdv: Do not insert space for '\n' if there already are spaces around
This commit is contained in:
parent
1007752106
commit
8e256fbf0f
@ -3962,10 +3962,11 @@ string MatchStringAdv::normalize(docstring const & s, bool ignore_format) const
|
||||
while ((pos = t.find("\n")) != string::npos) {
|
||||
if (pos > 1 && t[pos-1] == '\\' && t[pos-2] == '\\' ) {
|
||||
// Handle '\\\n'
|
||||
if (isAlnumASCII(t[pos+1])) {
|
||||
if (isPrintableNonspace(t[pos+1]) && ((pos < 3) || isPrintableNonspace(t[pos-3]))) {
|
||||
t.replace(pos-2, 3, " ");
|
||||
}
|
||||
else {
|
||||
// Already a space there
|
||||
t.replace(pos-2, 3, "");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user