commit 382963891c9b7781a2a6cfa91e8e2f95f4eb586d
parent eaa9aca1308b30dda651e530c6b5f164e3e30037
Author: Maria Solano <majosolano99@gmail.com>
Date: Tue, 14 Oct 2025 21:59:25 -0700
fix(undotree): check foldmethod before invoking fold (#36192)
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/runtime/pack/dist/opt/nvim.undotree/lua/undotree.lua b/runtime/pack/dist/opt/nvim.undotree/lua/undotree.lua
@@ -236,7 +236,10 @@ local function buf_apply_graph_lines(tree, graph_lines, buf, meta, find_seq)
local end_ = vim.api.nvim_buf_line_count(buf) - 1
local start = end_ - #line_buffer + 3
vim.api.nvim_buf_call(buf, function()
- vim.cmd.fold { range = { start, end_ } }
+ local w = vim.b[buf].nvim_is_undotree
+ if vim.api.nvim_win_is_valid(w) and vim.wo[w].foldmethod == 'manual' then
+ vim.cmd.fold { range = { start, end_ } }
+ end
end)
end