FindAdv: Amend f845a4e9

Also do not remove '\n' if in non-format-search mode. Otherwise
'\n' cannot be found with regex '\s'
This commit is contained in:
Kornel Benko 2022-05-14 09:51:23 +02:00
parent f845a4e9a3
commit cd6d21ebb3

View 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;