diff --git a/ftplugin/markdown.lua b/ftplugin/markdown.lua index bfbd829..2f243f8 100644 --- a/ftplugin/markdown.lua +++ b/ftplugin/markdown.lua @@ -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); diff --git a/lua/markview/renderer.lua b/lua/markview/renderer.lua index 9df5669..5cffe69 100644 --- a/lua/markview/renderer.lua +++ b/lua/markview/renderer.lua @@ -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)