nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 53d4224be9a73916eec82fd13e3fe60fef3555a0
parent f813fd0f4da308b86c04435fc3cbb40a8aa78ace
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon,  7 Oct 2019 17:18:45 +0200

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.

Diffstat:
Msrc/cut.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 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. */