]> git.wh0rd.org Git - nano.git/commitdiff
Differentiating (for the undo structure) between
authorBenno Schulenberg <bensberg@justemail.net>
Thu, 29 May 2014 18:50:13 +0000 (18:50 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Thu, 29 May 2014 18:50:13 +0000 (18:50 +0000)
deleting a newline and any other character.
Patch by Mark Majeres.

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

ChangeLog
src/text.c

index 2ba81a393b325a140c768af7738633b50e6bdff8..f1a388472d5e0ca15d3293586c6ff106380d1bbf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-05-29  Mark Majeres  <mark@engine12.com>
+       * src/text.c (do_delete): For the undo structure, differentiate
+       between deleting a newline and any other character.
+
 2014-05-29  Chris Allegretta <chrisa@asty.org>
        * src/chars.c (addstrings): Needs to be available even on
          non-utf-8 sustems.
index 8e32f00e53344e1b2d7691ab7bb9276e22861e0d..29d9fb07f870d96d44ee679a9bd4044e5e6dca1e 100644 (file)
@@ -68,10 +68,6 @@ void do_delete(void)
 {
     size_t orig_lenpt = 0;
 
-#ifndef NANO_TINY
-    update_undo(DEL);
-#endif
-
     assert(openfile->current != NULL && openfile->current->data != NULL && openfile->current_x <= strlen(openfile->current->data));
 
     openfile->placewewant = xplustabs();
@@ -84,6 +80,9 @@ void do_delete(void)
 
        assert(openfile->current_x < strlen(openfile->current->data));
 
+#ifndef NANO_TINY
+       update_undo(DEL);
+#endif
        if (ISSET(SOFTWRAP))
            orig_lenpt = strlenpt(openfile->current->data);
 
@@ -106,6 +105,9 @@ void do_delete(void)
 
        assert(openfile->current_x == strlen(openfile->current->data));
 
+#ifndef NANO_TINY
+       add_undo(DEL);
+#endif
        /* If we're deleting at the end of a line, we need to call
         * edit_refresh(). */
        if (openfile->current->data[openfile->current_x] == '\0')