From: Benno Schulenberg Date: Wed, 28 Oct 2015 20:24:15 +0000 (+0000) Subject: Spoofing a line number for the redoing of an INSERT, because X-Git-Tag: v2.5.0~87 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=3059e16c25831eea80a190fb1447207732f30029;p=nano.git Spoofing a line number for the redoing of an INSERT, because 'u->mark_begin_lineno' is being used as the length of the insertion. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5375 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 9c19c975..cf8993da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-10-28 Benno Schulenberg + * src/text.c (do_redo): For an INSERT, 'u->mark_begin_lineno' is not + an actual line number, so spoof it. It can be spoofed, because 'f' + is not used for the INSERT case. This fixes Savannah bug #45524. + 2015-10-27 Benno Schulenberg * src/move.c (do_next_word): Rewrite this function to use the same logic as do_prev_word(), reducing its number of lines to half. diff --git a/src/text.c b/src/text.c index ffea145b..e1b42f78 100644 --- a/src/text.c +++ b/src/text.c @@ -639,7 +639,7 @@ void do_redo(void) return; } - filestruct *f = fsfromline(u->mark_begin_lineno); + filestruct *f = fsfromline(u->type == INSERT ? 1 : u->mark_begin_lineno); if (!f) { statusbar(_("Internal error: can't match line %d. Please save your work."), u->mark_begin_lineno); return;