Also do not remove '\n' if in non-format-search mode. Otherwise
'\n' cannot be found with regex '\s'
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;