patch 9.0.1686: undotree() only works for the current buffer
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: #4001
closes: #12292
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Devin J. Pohly <djpohly@gmail.com>
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 8970ac7..0903fa8 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -2798,7 +2798,7 @@
ret_string, f_typename},
{"undofile", 1, 1, FEARG_1, arg1_string,
ret_string, f_undofile},
- {"undotree", 0, 0, 0, NULL,
+ {"undotree", 0, 1, FEARG_1, arg1_buffer,
ret_dict_any, f_undotree},
{"uniq", 1, 3, FEARG_1, arg13_sortuniq,
ret_first_arg, f_uniq},