aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/builtin.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/builtin.txt')
-rw-r--r--runtime/doc/builtin.txt13
1 files changed, 8 insertions, 5 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 94e9223ee9..9a662761c4 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -8399,7 +8399,7 @@ values({dict}) *values()*
in arbitrary order. Also see |items()| and |keys()|.
Returns zero if {dict} is not a |Dict|.
-virtcol({expr} [, {list}]) *virtcol()*
+virtcol({expr} [, {list} [, {winid}]]) *virtcol()*
The result is a Number, which is the screen column of the file
position given with {expr}. That is, the last screen position
occupied by the character at that position, when the screen
@@ -8431,10 +8431,13 @@ virtcol({expr} [, {list}]) *virtcol()*
returns the cursor position. Differs from |'<| in
that it's updated right away.
- If {list} is present and non-zero then virtcol() returns a List
- with the first and last screen position occupied by the
+ If {list} is present and non-zero then virtcol() returns a
+ List with the first and last screen position occupied by the
character.
+ With the optional {winid} argument the values are obtained for
+ that window instead of the current window.
+
Note that only marks in the current file can be used.
Examples: >vim
" With text "foo^Lbar" and cursor on the "^L":
@@ -8446,8 +8449,8 @@ virtcol({expr} [, {list}]) *virtcol()*
" With text " there", with 't at 'h':
echo virtcol("'t") " returns 6
-< Techo he first column is 1. 0 is returned for an error.
- A echo more advanced example that echoes the maximum length of
+< The first column is 1. 0 or [0, 0] is returned for an error.
+ A more advanced example that echoes the maximum length of
all lines: >vim
echo max(map(range(1, line('$')), "virtcol([v:val, '$'])"))