nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit e6709d684b45fc1ae9a48f1513d102f5338ffabf
parent aa257ef58e5d53fd7cba48eceec064f39ac9f2e2
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu, 20 Aug 2020 10:44:06 +0200

tweaks: condense two fragments of code, for compactness

Diffstat:
Msrc/search.c | 10++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/search.c b/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. */ - if (ISSET(BACKWARDS_SEARCH)) - line = line->prev; - else - line = line->next; + line = (ISSET(BACKWARDS_SEARCH)) ? line->prev : line->next; /* If we've reached the start or end of the buffer, wrap around; * 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; } - if (ISSET(BACKWARDS_SEARCH)) - line = openfile->filebot; - else - line = openfile->filetop; + line = (ISSET(BACKWARDS_SEARCH)) ? openfile->filebot : openfile->filetop; if (modus == JUSTFIND) { statusbar(_("Search Wrapped"));