Skip to content

Commit

Permalink
fix: images rendering below extmarks on same line
Browse files Browse the repository at this point in the history
  • Loading branch information
benlubas committed Nov 22, 2023
1 parent 7170a09 commit 0d3ab85
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/image/renderer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ local render = function(image)

local extmark_offset = topfill
for _, mark in ipairs(extmarks) do
if mark.row ~= original_y and mark.id ~= image:get_extmark_id() then
-- Break if we've reached the image's extmark, don't adjust for extmarks on the same
-- physical line but below the image's extmark
if mark.id == image:get_extmark_id() then break end
if mark.row ~= original_y then
-- check the mark is inside a fold, and skip adding the offset if it is
for fold_start, fold_end in pairs(folded_ranges) do
if mark.row >= fold_start and mark.row < fold_end then
Expand Down

0 comments on commit 0d3ab85

Please sign in to comment.