nano

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

commit 43754bd11d0e30000868278ec12389739b0c1d0e
parent acd904609380503cfe35795275fced36aee19236
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Wed, 26 Feb 2020 12:35:38 +0100

cutting: let M-T cut a trailing empty line, but not nothing at all

This fixes https://savannah.gnu.org/bugs/?57900.

Bug existed since version 4.0, commit 67873e96.

Diffstat:
Msrc/cut.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/cut.c b/src/cut.c @@ -589,9 +589,10 @@ void copy_text(void) /* Cut from the current cursor position to the end of the file. */ void cut_till_eof(void) { - if ((openfile->current == openfile->filebot && openfile->current->data[0] == '\0') || - (!ISSET(NO_NEWLINES) && openfile->current->next == openfile->filebot && - openfile->current->data[openfile->current_x] == '\0')) { + if (openfile->current->data[openfile->current_x] == '\0' && + (openfile->current->next == NULL || + (!ISSET(NO_NEWLINES) && openfile->current_x > 0 && + openfile->current->next == openfile->filebot))) { statusbar(_("Nothing was cut")); return; }