commit a0119b83cac3b5baab55e5e8f1ee49c8bbc92707
parent dba7a8a70a2b89342de5263ff4068839c9d82d7b
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 8 Apr 2020 11:25:02 +0200
tweaks: add two comments, and improve another
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/cut.c b/src/cut.c
@@ -588,6 +588,7 @@ void copy_text(void)
return;
}
+ /* When at the very end of the buffer, there is nothing to do. */
if (openfile->current->next == NULL && at_eol && (ISSET(CUT_FROM_CURSOR) ||
openfile->current_x == 0 || cutbuffer)) {
statusbar(_("Copied nothing"));
@@ -600,7 +601,7 @@ void copy_text(void)
if (ISSET(CUT_FROM_CURSOR))
sans_newline = !at_eol;
- /* Create OR add to the cutbuffer, depending on the mode, the position
+ /* Create the cutbuffer OR add to it, depending on the mode, the position
* of the cursor, and whether or not the cutbuffer is currently empty. */
if (cutbuffer == NULL && sans_newline) {
cutbuffer = addition;
@@ -626,6 +627,7 @@ void copy_text(void)
cutbottom->prev = addition;
}
+ /* When needed and possible, move the cursor to the next line. */
if ((!ISSET(CUT_FROM_CURSOR) || at_eol) && openfile->current->next) {
openfile->current = openfile->current->next;
openfile->current_x = 0;