nano

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

commit a578d2706c0cf39cdbc1bb1ca95cbcae5f159e58
parent 44d38815cc9f3ae16218530897b61ada24cb6414
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 30 Jun 2019 18:42:47 +0200

copying: do not prevent M-6 from copying emptiness into the cutbuffer

The check mistakenly prevented the user from copying a region that
ended at EOF.  Removing the check also gives the user a way to clear
the cutbuffer (with M-A M-6 or ^6 M-6, for example).

This fixes https://savannah.gnu.org/bugs/?56563.
Reported-by: Liu Hao <lh_mouse@126.com>

Diffstat:
Msrc/cut.c | 4----
Msrc/nano.c | 4+---
2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/cut.c b/src/cut.c @@ -406,10 +406,6 @@ void copy_text(void) ssize_t is_current_lineno = openfile->current->lineno; size_t is_current_x = openfile->current_x; - /* If there is nothing to copy, don't even try. */ - if (openfile->current->next == NULL && openfile->current->data[0] == '\0') - return; - do_cut_text(TRUE, mark_is_set, FALSE, FALSE); /* If the mark was set, restore the viewport and cursor position. */ diff --git a/src/nano.c b/src/nano.c @@ -288,10 +288,8 @@ void extract(linestruct *top, size_t top_x, linestruct *bot, size_t bot_x) bool mark_inside = FALSE; bool same_line = FALSE; - if (top == bot && top_x == bot_x) { - statusline(ALERT, "Extracting nothing -- please report a bug"); + if (top == bot && top_x == bot_x) return; - } #endif /* Partition the buffer so that it contains only the text from