mirror of
https://github.com/tiyn/nvim-docs-view.git
synced 2025-11-13 05:49:45 +01:00
fix: clear buffer before updating with new markdown (#8)
Before: Given two sets of hover documentation, a) longer text (more lines) and b) shorter text (fewer lines).. when moving from a) to b), the extra lines from a remain in the buffer. After: With this change, the buffer is cleared before adding new hover text, thus removing the excess trailing lines from any previous hover text.
This commit is contained in:
@@ -33,6 +33,7 @@ local function update()
|
||||
end
|
||||
|
||||
vim.api.nvim_buf_set_option(buf, "modifiable", true)
|
||||
vim.api.nvim_buf_set_lines(buf, 0, -1, true, {})
|
||||
vim.lsp.util.stylize_markdown(buf, md_lines)
|
||||
vim.api.nvim_buf_set_option(buf, "modifiable", false)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user