diff --git a/src/cut.c b/src/cut.c index 5236d7af..50376a0b 100644 --- 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);