Skip to content

Commit

Permalink
fix(renderer): Fixed a big causing numbered lists to use virtual text
Browse files Browse the repository at this point in the history
  • Loading branch information
OXY2DEV committed Aug 5, 2024
1 parent 135bd64 commit 6404094
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lua/markview/renderer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1321,15 +1321,23 @@ renderer.render_lists = function (buffer, content, config_table)
local before = content.spaces[l] or 0;

if vim.list_contains(content.list_candidates, l) and l == 1 then
local conceal_end = content.col_start + vim.fn.strchars(content.marker_symbol) - 1;

if content.marker_symbol:match("^%d+") then
conceal_end = vim.fn.strchars(content.list_lines[1]:match("^%s*"));
vim.print(conceal_end)
use_text = "";
end

vim.api.nvim_buf_set_extmark(buffer, renderer.namespace, line_num, 0, {
virt_text_pos = "inline",
virt_text = {
{ string.rep(" ", (math.floor(before / 2) + 1) * shift) },
{ vim.trim(use_text), set_hl(ls_conf.hl) or "Special" }
},

end_col = content.col_start + vim.fn.strchars(content.marker_symbol),
conceal = " "
end_col = conceal_end,
conceal = ""
})
elseif vim.list_contains(content.list_candidates, l) then
local line_len = vim.fn.strchars(line);
Expand Down

0 comments on commit 6404094

Please sign in to comment.