From d153771162bd9795d9f7142df5c674b61066a585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Fleur?= Date: Fri, 12 May 2023 06:42:39 +0000 Subject: [PATCH] fix(ghost_text): safely apply virtual_text highlight (#1563) --- lua/cmp/view/ghost_text_view.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/cmp/view/ghost_text_view.lua b/lua/cmp/view/ghost_text_view.lua index 91a1fe4f3..2b1dccc19 100644 --- a/lua/cmp/view/ghost_text_view.lua +++ b/lua/cmp/view/ghost_text_view.lua @@ -37,7 +37,7 @@ ghost_text_view.new = function() if #text > 0 then vim.api.nvim_buf_set_extmark(0, ghost_text_view.ns, row - 1, col, { right_gravity = false, - virt_text = { { text, c.hl_group or 'Comment' } }, + virt_text = { { text, type(c) == 'table' and c.hl_group or 'Comment' } }, virt_text_pos = 'overlay', hl_mode = 'combine', ephemeral = true,