diff options
-rw-r--r-- | src/nvim/term.c | 9 | ||||
-rw-r--r-- | 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) { |