From 7cf08b93ffb167332d7a57ab3d0a81fcc23c3160 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 27 Feb 2020 13:51:56 +0100 Subject: [PATCH] tweaks: don't bother reallocating the line data when undoing a line join --- src/text.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/text.c b/src/text.c index 24ad9fc4..0cf83da9 100644 --- a/src/text.c +++ b/src/text.c @@ -570,11 +570,9 @@ void do_undo(void) goto_line_posx(openfile->filebot->lineno, 0); break; } + line->data[u->head_x] = '\0'; intruder = make_new_node(line); intruder->data = copy_of(u->strdata); - data = measured_copy(line->data, u->tail_x); - free(line->data); - line->data = data; splice_node(line, intruder); renumber_from(intruder); goto_line_posx(u->head_lineno, u->head_x);