nano

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

commit 59b9b222c80905f12fafffc57f62cd9f349cc02a
parent 79e3eaf73c0d8ff77800c0bb9ecd01d93ad48a89
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Tue, 21 Jun 2016 16:47:11 +0200

moving: ignore any number when ^Y or ^V is given

This fixes https://savannah.gnu.org/bugs/?48282.

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

diff --git a/src/search.c b/src/search.c @@ -912,7 +912,7 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer, /* TRANSLATORS: This is a prompt. */ edit_refresh, _("Enter line number, column number")); - /* Cancel, or Enter with blank string. */ + /* If the user cancelled or gave a blank answer, get out. */ if (i < 0) { statusbar(_("Cancelled")); return; @@ -921,20 +921,21 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer, func = func_from_key(&i); if (func == gototext_void) { - /* Keep answer up on the statusbar. */ + /* Retain what the user typed so far and switch to searching. */ search_init(TRUE, TRUE); - do_search(); - return; } + /* If a function was executed, we're done here. */ + if (i > 0) + return; + /* Do a bounds check. Display a warning on an out-of-bounds * line or column number only if we hit Enter at the statusbar * prompt. */ if (!parse_line_column(answer, &line, &column) || line < 1 || column < 1) { - if (i == 0) - statusbar(_("Invalid line or column number")); + statusbar(_("Invalid line or column number")); return; } } else {