Differentiating (for the undo structure) between

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
master
Benno Schulenberg 2014-05-29 18:50:13 +00:00
parent 82a411077a
commit ff36b05cdb
2 changed files with 10 additions and 4 deletions

View File

@ -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.

View 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')