tweaks: condense two fragments of code, for compactness
parent
aa257ef58e
commit
e6709d684b
10
src/search.c
10
src/search.c
|
@ -275,10 +275,7 @@ int findnextstr(const char *needle, bool whole_word_only, int modus,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move to the previous or next line in the file. */
|
/* Move to the previous or next line in the file. */
|
||||||
if (ISSET(BACKWARDS_SEARCH))
|
line = (ISSET(BACKWARDS_SEARCH)) ? line->prev : line->next;
|
||||||
line = line->prev;
|
|
||||||
else
|
|
||||||
line = line->next;
|
|
||||||
|
|
||||||
/* If we've reached the start or end of the buffer, wrap around;
|
/* If we've reached the start or end of the buffer, wrap around;
|
||||||
* but stop when spell-checking or replacing in a region. */
|
* but stop when spell-checking or replacing in a region. */
|
||||||
|
@ -288,10 +285,7 @@ int findnextstr(const char *needle, bool whole_word_only, int modus,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ISSET(BACKWARDS_SEARCH))
|
line = (ISSET(BACKWARDS_SEARCH)) ? openfile->filebot : openfile->filetop;
|
||||||
line = openfile->filebot;
|
|
||||||
else
|
|
||||||
line = openfile->filetop;
|
|
||||||
|
|
||||||
if (modus == JUSTFIND) {
|
if (modus == JUSTFIND) {
|
||||||
statusbar(_("Search Wrapped"));
|
statusbar(_("Search Wrapped"));
|
||||||
|
|
Loading…
Reference in New Issue