]> git.lyx.org Git - features.git/commitdiff
FindAdv: Amend f845a4e9
authorKornel Benko <kornel@lyx.org>
Sat, 14 May 2022 07:51:23 +0000 (09:51 +0200)
committerKornel Benko <kornel@lyx.org>
Sat, 14 May 2022 07:51:23 +0000 (09:51 +0200)
Also do not remove '\n' if in non-format-search mode. Otherwise
'\n' cannot be found with regex '\s'

src/lyxfind.cpp

index b996cd0f9f02e460858bf25a28b95307e0e303d0..480d4d18bab54e8248d2faca06952f0128a83cb0 100644 (file)
@@ -3986,12 +3986,14 @@ static string convertLF2Space(docstring const &s, bool ignore_format)
        size_t pos;
        size_t start = 0;
        size_t end = s.size() - 1;
-       while (s[start] == '\n' && start <= end)
-               start++;
-       while (end >= start && s[end] == '\n')
-               end--;
-       if (start >= end + 1)
-               return "";
+       if (!ignore_format) {
+               while (s[start] == '\n' && start <= end)
+                       start++;
+               while (end >= start && s[end] == '\n')
+                       end--;
+               if (start >= end + 1)
+                       return "";
+       }
        do {
                bool dospace = true;
                int skip = -1;