Commit e3b13ae1 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

tweaks: reshuffle a couple of lines

No related merge requests found
Showing with 6 additions and 9 deletions
+6 -9
...@@ -250,22 +250,19 @@ int findnextstr(const char *needle, bool whole_word_only, int modus, ...@@ -250,22 +250,19 @@ int findnextstr(const char *needle, bool whole_word_only, int modus,
statusbar(_("Searching...")); statusbar(_("Searching..."));
} }
/* Search for the needle in the current line. */ /* When starting a new search, skip the first character, then
if (!skipone) * (in either case) search for the needle in the current line. */
found = strstrwrapper(line->data, needle, from);
/* When starting a new search, skip the first character. */
if (skipone) { if (skipone) {
skipone = FALSE; skipone = FALSE;
if (ISSET(BACKWARDS_SEARCH) && from != line->data) { if (ISSET(BACKWARDS_SEARCH) && from != line->data) {
from = line->data + move_mbleft(line->data, from - line->data); from = line->data + move_mbleft(line->data, from - line->data);
continue; found = strstrwrapper(line->data, needle, from);
} else if (!ISSET(BACKWARDS_SEARCH) && *from != '\0') { } else if (!ISSET(BACKWARDS_SEARCH) && *from != '\0') {
from += move_mbright(from, 0); from += move_mbright(from, 0);
continue; found = strstrwrapper(line->data, needle, from);
}
found = NULL;
} }
} else
found = strstrwrapper(line->data, needle, from);
if (found != NULL) { if (found != NULL) {
/* When doing a regex search, compute the length of the match. */ /* When doing a regex search, compute the length of the match. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment