From 53d4224be9a73916eec82fd13e3fe60fef3555a0 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 7 Oct 2019 17:18:45 +0200 Subject: [PATCH] cutting: do nothing when trying to chop a word leftward at start of file Instead of marking the buffer as modified, provide the feedback that "nothing was cut", like when trying to chop a word rightward at the end of the buffer. This fixes https://savannah.gnu.org/bugs/?57015. Bug existed since version 4.4, commit 4314b8de. --- src/cut.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cut.c b/src/cut.c index 8481a3df..27478918 100644 --- a/src/cut.c +++ b/src/cut.c @@ -194,7 +194,10 @@ void chop_word(bool forward) /* Delete a word leftward. */ void chop_previous_word(void) { - chop_word(BACKWARD); + if (openfile->current->prev == NULL && openfile->current_x == 0) + statusbar(_("Nothing was cut")); + else + chop_word(BACKWARD); } /* Delete a word rightward. */