mirror of
https://github.com/neovim/neovim.git
synced 2025-10-14 22:06:07 +00:00
fix(undotree): sync scroll pos with undo #36117
Problem: when undo in buffer, undotree window is not updated to position of correct node Solution: schedule nvim_win_set_cursor
This commit is contained in:
@@ -264,9 +264,11 @@ local function draw(inbuf, outbuf)
|
||||
local curseq_line = buf_apply_graph_lines(tree, graph_lines, outbuf, meta, curseq)
|
||||
vim.bo[outbuf].modifiable = false
|
||||
|
||||
if vim.api.nvim_win_is_valid(vim.b[outbuf].nvim_is_undotree) then
|
||||
vim.api.nvim_win_set_cursor(vim.b[outbuf].nvim_is_undotree, { curseq_line, 0 })
|
||||
end
|
||||
vim.schedule(function()
|
||||
if vim.api.nvim_win_is_valid(vim.b[outbuf].nvim_is_undotree) then
|
||||
vim.api.nvim_win_set_cursor(vim.b[outbuf].nvim_is_undotree, { curseq_line, 0 })
|
||||
end
|
||||
end)
|
||||
|
||||
return meta
|
||||
end
|
||||
|
Reference in New Issue
Block a user