From 6e0c36ba0e6691401726fd4215f89729138ba82f Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 12 Aug 2023 05:51:49 +0800 Subject: vim-patch:9.0.1686: undotree() only works for the current buffer (#24665) Problem: undotree() only works for the current buffer Solution: Add an optional "buffer number" parameter to undotree(). If omitted, use the current buffer for backwards compatibility. closes: vim/vim#4001 closes: vim/vim#12292 https://github.com/vim/vim/commit/5fee11114975b7405b7ccd3ee8758e54bf559760 Co-authored-by: Devin J. Pohly --- runtime/lua/vim/_meta/vimfn.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 14aae99971..bf80ccab45 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -9733,8 +9733,9 @@ function vim.fn.type(expr) end --- @return string function vim.fn.undofile(name) end ---- Return the current state of the undo tree in a dictionary with ---- the following items: +--- Return the current state of the undo tree for the current +--- buffer, or for a specific buffer if {buf} is given. The +--- result is a dictionary with the following items: --- "seq_last" The highest undo sequence number used. --- "seq_cur" The sequence number of the current position in --- the undo tree. This differs from "seq_last" @@ -9775,8 +9776,9 @@ function vim.fn.undofile(name) end --- blocks. Each item may again have an "alt" --- item. --- +--- @param buf? any --- @return any -function vim.fn.undotree() end +function vim.fn.undotree(buf) end --- Remove second and succeeding copies of repeated adjacent --- {list} items in-place. Returns {list}. If you want a list -- cgit