Mercurial > vim
diff runtime/doc/eval.txt @ 13280:fbda23eb0996 v8.0.1514
patch 8.0.1514: getting the list of changes is not easy
commit https://github.com/vim/vim/commit/07ad816525da67cab3c0db21d1286d221dbc7477
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 13 13:59:59 2018 +0100
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 13 Feb 2018 14:15:05 +0100 |
parents | abaebba89fd4 |
children | a88c5e12b860 |
line wrap: on
line diff
--- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2152,6 +2152,7 @@ getbufline({expr}, {lnum} [, {end}]) 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 @@ getbufvar({expr}, {varname} [, {def}]) :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.