tweak do_delete() to not mark the file as modified if we delete the

newline before filebot and a magicline is added as a result, as it did
before the NO_NEWLINES flag was added


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3111 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2005-11-08 22:59:10 +00:00
parent 126cc1c8dd
commit d84cfb03df
1 changed files with 7 additions and 2 deletions

View File

@ -96,6 +96,8 @@ void do_delete(void)
openfile->mark_begin_x -= char_buf_len; openfile->mark_begin_x -= char_buf_len;
#endif #endif
openfile->totsize--; openfile->totsize--;
set_modified();
} else if (openfile->current != openfile->filebot) { } else if (openfile->current != openfile->filebot) {
filestruct *foo = openfile->current->next; filestruct *foo = openfile->current->next;
@ -130,14 +132,17 @@ void do_delete(void)
/* If the NO_NEWLINES flag isn't set, and text has been added to /* If the NO_NEWLINES flag isn't set, and text has been added to
* the magicline as a result of deleting at the end of the line * the magicline as a result of deleting at the end of the line
* before filebot, add a new magicline. */ * before filebot, add a new magicline. This effectively leaves
* the text unchanged, so don't mark the file as modified after
* doing this. */
if (!ISSET(NO_NEWLINES) && openfile->current == if (!ISSET(NO_NEWLINES) && openfile->current ==
openfile->filebot && openfile->current->data[0] != '\0') openfile->filebot && openfile->current->data[0] != '\0')
new_magicline(); new_magicline();
else
set_modified();
} else } else
return; return;
set_modified();
#ifdef ENABLE_COLOR #ifdef ENABLE_COLOR
/* If color syntaxes are available and turned on, we need to call /* If color syntaxes are available and turned on, we need to call