From b4f516a36a5c15bd9a8722fea13101c0d06aa086 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Sat, 10 Jan 2015 02:37:22 -0300 Subject: [PATCH] ui: Fix out_flush/ui_write behavior to always flush for abstract_ui --- src/nvim/term.c | 9 +++------ src/nvim/ui.c | 4 ++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/nvim/term.c b/src/nvim/term.c index c75f9272e3..a1e13cfeb7 100644 --- a/src/nvim/term.c +++ b/src/nvim/term.c @@ -1822,12 +1822,9 @@ static int out_pos = 0; /* number of chars in out_buf */ */ void out_flush(void) { - if (out_pos != 0) { - /* set out_pos to 0 before ui_write, to avoid recursiveness */ - int len = out_pos; - out_pos = 0; - ui_write(out_buf, len); - } + int len = out_pos; + out_pos = 0; + ui_write(out_buf, len); } /* diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 3e5639d23e..77ab948809 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -95,6 +95,10 @@ void ui_write(uint8_t *s, int len) return; } + if (!len) { + return; + } + char_u *tofree = NULL; if (output_conv.vc_type != CONV_NONE) {