From c06504687dd47b10d1acd51d6360a513e36e3de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Linse?= Date: Mon, 3 Jun 2019 21:31:01 +0200 Subject: [PATCH] msg_puts_attr_len: check default_grid.chars if headless Nvim might call `msg_puts_attr_len` before the screen buffers are allocated. --- src/nvim/message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/message.c b/src/nvim/message.c index 5f3d367504..5188824901 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1812,7 +1812,7 @@ void msg_puts_attr_len(const char *const str, const ptrdiff_t len, int attr) msg_col = saved_msg_col; } } - if (!msg_use_printf() || headless_mode) { + if (!msg_use_printf() || (headless_mode && default_grid.chars)) { msg_puts_display((const char_u *)str, len, attr, false); } }