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>
This commit is contained in:
@@ -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. */
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user