Commit ff36b05c authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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
No related merge requests found
Showing with 10 additions and 4 deletions
+10 -4
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.
......
......@@ -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')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment