From 34b31e8451829e7b515a60cf12183203a059d1c4 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Mon, 16 Apr 2018 16:19:54 +0200 Subject: record line info on empty lines --- src/fe-common/core/formats.c | 9 +++++++++ src/fe-text/textbuffer.c | 3 --- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/fe-common/core/formats.c b/src/fe-common/core/formats.c index 4c819c2d..8ad4b3af 100644 --- a/src/fe-common/core/formats.c +++ b/src/fe-common/core/formats.c @@ -1233,6 +1233,15 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text) dup = str = g_strdup(text); flags = 0; fgcolor = theme->default_color; bgcolor = -1; + + if (*str == '\0') { + /* empty line, write line info only */ + signal_emit_id(signal_gui_print_text, 6, dest->window, + GINT_TO_POINTER(fgcolor), + GINT_TO_POINTER(bgcolor), + GINT_TO_POINTER(flags), str, + dest); + } while (*str != '\0') { type = '\0'; for (ptr = str; *ptr != '\0'; ptr++) { diff --git a/src/fe-text/textbuffer.c b/src/fe-text/textbuffer.c index 01cdd118..9e1ace96 100644 --- a/src/fe-text/textbuffer.c +++ b/src/fe-text/textbuffer.c @@ -355,9 +355,6 @@ LINE_REC *textbuffer_insert(TEXT_BUFFER_REC *buffer, LINE_REC *insert_after, g_return_val_if_fail(buffer != NULL, NULL); g_return_val_if_fail(data != NULL, NULL); - if (len == 0) - return insert_after; - line = !buffer->last_eol ? insert_after : textbuffer_line_insert(buffer, insert_after); -- cgit v1.2.3