commit 8e256fbf0fb1fdffafe5bb35e18a0746d3ce8d1f Author: Kornel Benko <kor...@lyx.org> Date: Wed May 11 17:42:50 2022 +0200
FindAdv: Do not insert space for '\n' if there already are spaces around --- src/lyxfind.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index 7048fc2..8c609a7 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -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, ""); } } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs