Skip to content

Commit 66c96bc

Browse files
committed
fix(concealer): only apply highlight to the virtual icon and not the spacing before it
1 parent 9a60686 commit 66c96bc

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

lua/neorg/modules/core/concealer/module.lua

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -466,13 +466,18 @@ module.public = {
466466
return
467467
end
468468

469-
local text = (" "):rep(len - 1) .. icon
470-
471-
local _, first_unicode_end = text:find("[%z\1-\127\194-\244][\128-\191]*", len)
469+
local _, first_unicode_end = icon:find("[%z\1-\127\194-\244][\128-\191]*", len)
472470
local highlight = config.highlights and table_get_default_last(config.highlights, len)
473-
set_mark(bufid, row_0b, col_0b, text:sub(1, first_unicode_end), highlight)
474-
if vim.fn.strcharlen(text) > len then
475-
set_mark(bufid, row_0b, col_0b + len, text:sub(first_unicode_end + 1), highlight, {
471+
-- set_mark(bufid, row_0b, 0, "", highlight, {
472+
-- end_row = row_0b + 1,
473+
-- end_col = 0,
474+
-- hl_eol = true,
475+
-- hl_group = highlight,
476+
-- })
477+
set_mark(bufid, row_0b, col_0b, (" "):rep(len - 1), "Normal")
478+
set_mark(bufid, row_0b, col_0b + len - 1, icon:sub(1, first_unicode_end), highlight)
479+
if vim.fn.strcharlen(icon) > 1 then
480+
set_mark(bufid, row_0b, col_0b + len, icon:sub(first_unicode_end + 1), highlight, {
476481
virt_text_pos = "inline",
477482
})
478483
end

0 commit comments

Comments
 (0)