nano

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

commit 88309f981af05e7374364f7a721f160b61b698aa
parent 653432b6a8aa3472670924354c5e4c4bb6b0a65c
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun,  6 Jul 2025 15:01:26 +0200

tweaks: put two related checks together, like they are elsewhere

Diffstat:
Msrc/search.c | 15++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/search.c b/src/search.c @@ -718,7 +718,7 @@ void ask_for_and_do_replacements(void) update_history(&replace_history, answer, PRUNE_DUPLICATE); #endif - /* When cancelled, or when a function was run, get out. */ + /* When cancelled, or when a function was run, we're done. */ if (response == -1) { statusbar(_("Cancelled")); return; @@ -778,12 +778,6 @@ void ask_for_line_and_column(char *provided) _("Enter line number, column number")); int doublesign = 0; - /* If the user cancelled or gave a blank answer, get out. */ - if (response < 0) { - statusbar(_("Cancelled")); - return; - } - if (func_from_key(response) == flip_goto) { UNSET(BACKWARDS_SEARCH); /* Switch to searching but retain what the user typed so far. */ @@ -791,8 +785,11 @@ void ask_for_line_and_column(char *provided) return; } - /* If a function was executed, we're done here. */ - if (response > 0) + /* When cancelled or blank, or when a function was run, we're done. */ + if (response < 0) { + statusbar(_("Cancelled")); + return; + } else if (response > 0) return; /* A ++ or -- before the number signifies a relative jump. */