diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2023-08-12 05:51:49 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-12 05:51:49 +0800 |
| commit | 6e0c36ba0e6691401726fd4215f89729138ba82f (patch) | |
| tree | c8eb7c4cfacbd72da41254f3f69b4e97f821ee8b /src/nvim/eval.lua | |
| parent | 278805dfacc865c594c383f6f1fb7eeaf307aa15 (diff) | |
| download | rneovim-6e0c36ba0e6691401726fd4215f89729138ba82f.tar.gz rneovim-6e0c36ba0e6691401726fd4215f89729138ba82f.tar.bz2 rneovim-6e0c36ba0e6691401726fd4215f89729138ba82f.zip | |
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 <djpohly@gmail.com>
Diffstat (limited to 'src/nvim/eval.lua')
| -rw-r--r-- | src/nvim/eval.lua | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 4e6688a4a1..a09580cd75 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -11620,9 +11620,12 @@ M.funcs = { signature = 'undofile({name})', }, undotree = { + args = { 0, 1 }, + base = 1, desc = [=[ - 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" @@ -11664,8 +11667,8 @@ M.funcs = { item. ]=], name = 'undotree', - params = {}, - signature = 'undotree()', + params = { { 'buf', 'any' } }, + signature = 'undotree([{buf}])', }, uniq = { args = { 1, 3 }, |