fix(undotree): check foldmethod before invoking fold (#36192)

This commit is contained in:
Maria Solano
2025-10-14 21:59:25 -07:00
committed by GitHub
parent eaa9aca130
commit 382963891c

View File

@@ -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()
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