Skip to content

Commit

Permalink
fix: commit error
Browse files Browse the repository at this point in the history
  • Loading branch information
3rd committed Oct 17, 2023
1 parent fb929d0 commit aa3004e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/image/image.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function Image:render(geometry)

-- clear previous extmark if rendering was prevented
if not was_rendered and previous_extmark then
-- utils.debug(("(image.render) clearing extmark %s"):format(previous_extmark.id))
if vim.api.nvim_buf_is_valid(self.buffer) then
vim.api.nvim_buf_del_extmark(self.buffer, self.global_state.extmarks_namespace, previous_extmark.id)
end
Expand All @@ -61,6 +62,7 @@ function Image:render(geometry)

if not has_up_to_date_extmark then
if previous_extmark ~= nil then
-- utils.debug(("(image.render) clearing extmark %s"):format(previous_extmark.id))
vim.api.nvim_buf_del_extmark(self.buffer, self.global_state.extmarks_namespace, previous_extmark.id)
end

Expand All @@ -69,8 +71,8 @@ function Image:render(geometry)
for _ = 0, height - 1 do
filler[#filler + 1] = { { text, "" } }
end
vim.api.nvim_buf_set_extmark(self.buffer, self.global_state.extmarks_namespace, row > 0 and row - 1 or 0, 0, {

-- utils.debug(("(image.render) creating extmark %s"):format(self.internal_id))
local ok = pcall(
vim.api.nvim_buf_set_extmark,
self.buffer,
Expand Down

0 comments on commit aa3004e

Please sign in to comment.