Skip to content

Commit

Permalink
fix(renderer): Fixed a bug leading to extmarks on the current line no…
Browse files Browse the repository at this point in the history
…t being removed

The current line will also be cleared(after clearing everything else)
now.
  • Loading branch information
OXY2DEV committed Aug 4, 2024
1 parent 139fca5 commit 777c6aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions ftplugin/markdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ vim.api.nvim_create_autocmd(events, {

markview.renderer.clear_content_range(event.buf, partial_contents)
markview.renderer.clear_content_range(event.buf, prev_contents);
markview.renderer.clear(event.buf, parse_start, parse_stop);

markview.renderer.render_in_range(event.buf, prev_contents, markview.configuration);
markview.renderer.update_range(event.buf, current_range);
Expand Down
4 changes: 2 additions & 2 deletions lua/markview/renderer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1576,8 +1576,8 @@ renderer.render = function (buffer, parsed_content, config_table, conceal_start,
end
end

renderer.clear = function (buffer)
vim.api.nvim_buf_clear_namespace(buffer, renderer.namespace, 0, -1)
renderer.clear = function (buffer, from, to)
vim.api.nvim_buf_clear_namespace(buffer, renderer.namespace, from or 0, to or -1)
end

renderer.update_range = function (buffer, new_range)
Expand Down

0 comments on commit 777c6aa

Please sign in to comment.