mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
feat(image): when opts.conceal, conceal remainig lines that are not covered by the image. See #2391
This commit is contained in:
parent
13963b1ec4
commit
404027c973
1 changed files with 11 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue