feat(image): when opts.conceal, conceal remainig lines that are not covered by the image. See #2391

This commit is contained in:
Folke Lemaitre 2025-10-30 09:14:13 +01:00
parent 13963b1ec4
commit 404027c973
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -272,7 +272,6 @@ function M:render_grid(loc)
end
end
end
-- can_overlay = false
if height == 1 and #lines == 1 then
-- render inline
@ -319,6 +318,17 @@ function M:render_grid(loc)
virt_text_win_col = offset,
}
end
-- conceal remaining lines if any
local last = extmarks[#extmarks]
if last and #img == 0 and (last.row < range[3] - 1) and vim.fn.has("nvim-0.11.4") == 1 then
extmarks[#extmarks + 1] = {
row = last.row + 1,
end_row = range[3] - 1,
col = 0,
conceal_lines = "",
virt_text_hide = false,
}
end
end
if #img > 0 then
-- add additional virtual lines if there are more lines to render