]> git.wh0rd.org Git - nano.git/commitdiff
Removing an 'if' that will never be true, and removing some
authorBenno Schulenberg <bensberg@justemail.net>
Thu, 29 Oct 2015 17:27:33 +0000 (17:27 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Thu, 29 Oct 2015 17:27:33 +0000 (17:27 +0000)
assignments that have already been done.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5381 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/text.c

index 785da688da2adf03eb0e8bd27d1cc641be223f0a..d4d38b889cf17bba0fcc08ee052d88f4bcd14763 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,8 @@
        typing text is broken by an undo+redo.  Fixes Savannah bug #46323.
        * src/text.c (do_redo): Check for "nothing to redo" earlier, so we
        can restore the possible warning about an internal error.
+       * src/text.c (add_undo): Remove an 'if' that will never be true,
+       and remove some assignments that have already been done.
 
 2015-10-29  David Lawrence Ramsey  <pooka109@gmail.com>
        * src/files.c (do_writeout), src/nano.c (no_current_file_name_warning,
index c24ddeb1e2e70f4ed8400888eaadf2cb77ee7ff5..5c1c851857c635e25d07ef0fc2b500b2fd37e17e 100644 (file)
@@ -1026,12 +1026,8 @@ void add_undo(undo_type action)
        if (!cutbuffer)
            statusbar(_("Internal error: cannot set up uncut.  Please save your work."));
        else {
-           if (u->cutbuffer)
-               free_filestruct(u->cutbuffer);
            u->cutbuffer = copy_filestruct(cutbuffer);
-           u->mark_begin_lineno = fs->current->lineno;
-           u->mark_begin_x = fs->current_x;
-           u->lineno = fs->current->lineno + cutbottom->lineno - cutbuffer->lineno;
+           u->lineno += cutbottom->lineno - cutbuffer->lineno;
            u->mark_set = TRUE;
        }
        break;