commit 0c561f03253fdbe906bd6f3be8a946eea8682ff5
parent e5831f81bb553e598e9a543f977e0c5a150bf88e
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 30 Apr 2019 19:03:18 +0200
copying: make M-6 do nothing when at end of buffer
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/cut.c b/src/cut.c
@@ -408,6 +408,10 @@ void do_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;
+
if (mark_is_set || openfile->current != next_contiguous_line)
keep_cutbuffer = FALSE;