Add experimental.ghost_text.hl_group

This commit is contained in:
hrsh7th
2021-09-07 01:38:49 +09:00
parent abed04a6d4
commit b6b15d5f6e
2 changed files with 8 additions and 4 deletions

View File

@@ -36,7 +36,8 @@ core.menu = menu.new({
core.ghost_text = function(e)
vim.api.nvim_buf_clear_namespace(0, core.GHOST_TEXT_NS, 0, -1)
if not config.get().experimental.ghost_text then
local c = config.get().experimental.ghost_text
if not c then
return
end
@@ -58,7 +59,7 @@ core.ghost_text = function(e)
if #text > 0 then
vim.api.nvim_buf_set_extmark(ctx.bufnr, core.GHOST_TEXT_NS, ctx.cursor.row - 1, ctx.cursor.col - 1, {
right_gravity = false,
virt_text = { { text, 'Comment' } },
virt_text = { { text, c.hl_group } },
virt_text_pos = 'overlay',
virt_text_win_col = ctx.virtcol - 1,
priority = 1,