From 0f6236f556b67ddf918b3f1034903cab3d0051f0 Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Wed, 9 Nov 2005 00:08:29 +0000
Subject: [PATCH] *really* make deleting and cutting text consistent with each
 other, and fix comments

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3115 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 src/cut.c  | 2 +-
 src/text.c | 9 ++-------
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/cut.c b/src/cut.c
index 5581a243..dd384762 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -31,7 +31,7 @@
 static bool keep_cutbuffer = FALSE;
 	/* Should we keep the contents of the cutbuffer? */
 static filestruct *cutbottom = NULL;
-	/* Pointer to end of cutbuffer. */
+	/* Pointer to the end of the cutbuffer. */
 
 void cutbuffer_reset(void)
 {
diff --git a/src/text.c b/src/text.c
index c135c5d2..4d6d855b 100644
--- a/src/text.c
+++ b/src/text.c
@@ -96,8 +96,6 @@ void do_delete(void)
 	    openfile->mark_begin_x -= char_buf_len;
 #endif
 	openfile->totsize--;
-
-	set_modified();
     } else if (openfile->current != openfile->filebot) {
 	filestruct *foo = openfile->current->next;
 
@@ -132,17 +130,14 @@ void do_delete(void)
 
 	/* 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
-	 * before filebot, add a new magicline.  This effectively leaves
-	 * the text unchanged, so don't mark the file as modified after
-	 * doing this. */
+	 * before filebot, add a new magicline. */
 	if (!ISSET(NO_NEWLINES) && openfile->current ==
 		openfile->filebot && openfile->current->data[0] != '\0')
 	    new_magicline();
-	else
-	    set_modified();
     } else
 	return;
 
+    set_modified();
 
 #ifdef ENABLE_COLOR
     /* If color syntaxes are available and turned on, we need to call
-- 
GitLab