patch 8.0.1514: getting the list of changes is not easy
Problem: Getting the list of changes is not easy.
Solution: Add the getchangelist() function. (Yegappan Lakshmanan,
closes #2634)
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 8f14ddd..87c84bb 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2152,6 +2152,7 @@
List lines {lnum} to {end} of buffer {expr}
getbufvar({expr}, {varname} [, {def}])
any variable {varname} in buffer {expr}
+getchangelist({expr}) List list of change list items
getchar([expr]) Number get one character from the user
getcharmod() Number modifiers for the last typed character
getcharsearch() Dict last character search
@@ -4278,6 +4279,22 @@
:let bufmodified = getbufvar(1, "&mod")
:echo "todo myvar = " . getbufvar("todo", "myvar")
<
+getchangelist({expr}) *getchangelist()*
+ Returns the |changelist| for the buffer {expr}. For the use
+ of {expr}, see |bufname()| above. If buffer {expr} doesn't
+ exist, an empty list is returned.
+
+ The returned list contains two entries: a list with the change
+ locations and the current position in the list. Each
+ entry in the change list is a dictionary with the following
+ entries:
+ col column number
+ coladd column offset for 'virtualedit'
+ lnum line number
+ If buffer {expr} is the current buffer, then the current
+ position refers to the position in the list. For other
+ buffers, it is set to the length of the list.
+
getchar([expr]) *getchar()*
Get a single character from the user or input stream.
If [expr] is omitted, wait until a character is available.