commit 7660849b8ff498239d6f4ea575f860d4344542a6
parent 4b814698bd6c8040ea89b7ac07f211bd2208f129
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 31 Mar 2020 19:17:17 +0200
tweaks: invert a condition, to see the similarity between the two modes
The two modes being: the normal full-line cutting, and --cutfromcursor.
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/cut.c b/src/cut.c
@@ -598,15 +598,15 @@ void copy_text(void)
cutbottom = make_new_node(cutbuffer);
cutbottom->data = copy_of("");
cutbuffer->next = cutbottom;
- } else if (at_eol) {
- addition->prev = cutbottom;
- cutbottom->next = addition;
- cutbottom = addition;
- } else {
+ } else if (!at_eol) {
addition->prev = cutbottom->prev;
addition->prev->next = addition;
delete_node(cutbottom);
cutbottom = addition;
+ } else {
+ addition->prev = cutbottom;
+ cutbottom->next = addition;
+ cutbottom = addition;
}
} else {
addition->data = copy_of(openfile->current->data);