From 27b684b83f393fb65e27840ca7cdfe09ad341e8e Mon Sep 17 00:00:00 2001 From: erw7 Date: Wed, 29 May 2019 16:23:55 +0900 Subject: Fix screenchar() problem in headless mode In the case of the headless mode, screenchar() does not operate normally because it is not output to the internal screen. Change output to stderr and internal screen to fix it. --- src/nvim/message.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/message.c b/src/nvim/message.c index a597fb4866..5f3d367504 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1806,8 +1806,13 @@ void msg_puts_attr_len(const char *const str, const ptrdiff_t len, int attr) // different, e.g. for Win32 console) or we just don't know where the // cursor is. if (msg_use_printf()) { + int saved_msg_col = msg_col; msg_puts_printf(str, len); - } else { + if (headless_mode) { + msg_col = saved_msg_col; + } + } + if (!msg_use_printf() || headless_mode) { msg_puts_display((const char_u *)str, len, attr, false); } } -- cgit