summaryrefslogtreecommitdiffstats
path: root/runtime/doc/builtin.txt
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2022-11-12 16:07:47 +0000
committerBram Moolenaar <Bram@vim.org>2022-11-12 16:07:47 +0000
commit4c8d2f02b3ce037bbe1d5ee12887e343c6bde88f (patch)
treeb9f8e07114c29a8427817d5c9aa8ab37b2c13b3c /runtime/doc/builtin.txt
parent0aad88f073602849d1623122eb3c323f8e252def (diff)
patch 9.0.0863: col() and charcol() only work for the current windowv9.0.0863
Problem: col() and charcol() only work for the current window. Solution: Add an optional winid argument. (Yegappan Lakshmanan, closes #11466, closes #11461)
Diffstat (limited to 'runtime/doc/builtin.txt')
-rw-r--r--runtime/doc/builtin.txt15
1 files changed, 9 insertions, 6 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 372fa1f68c..ff93437caf 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -116,13 +116,13 @@ ch_status({handle} [, {options}])
changenr() Number current change number
char2nr({expr} [, {utf8}]) Number ASCII/UTF-8 value of first char in {expr}
charclass({string}) Number character class of {string}
-charcol({expr}) Number column number of cursor or mark
+charcol({expr} [, {winid}]) Number column number of cursor or mark
charidx({string}, {idx} [, {countcc}])
Number char index of byte {idx} in {string}
chdir({dir}) String change current working directory
cindent({lnum}) Number C indent for line {lnum}
clearmatches([{win}]) none clear all matches
-col({expr}) Number column byte index of cursor or mark
+col({expr} [, {winid}]) Number column byte index of cursor or mark
complete({startcol}, {matches}) none set Insert mode completion
complete_add({expr}) Number add completion match
complete_check() Number check for key typed during completion
@@ -1474,7 +1474,7 @@ charclass({string}) *charclass()*
Returns 0 if {string} is not a |String|.
-charcol({expr}) *charcol()*
+charcol({expr} [, {winid}]) *charcol()*
Same as |col()| but returns the character index of the column
position given with {expr} instead of the byte position.
@@ -1557,8 +1557,8 @@ clearmatches([{win}]) *clearmatches()*
Can also be used as a |method|: >
GetWin()->clearmatches()
<
- *col()*
-col({expr}) The result is a Number, which is the byte index of the column
+col({expr} [, {winid}) *col()*
+ The result is a Number, which is the byte index of the column
position given with {expr}. The accepted positions are:
. the cursor position
$ the end of the cursor line (the result is the
@@ -1573,6 +1573,8 @@ col({expr}) The result is a Number, which is the byte index of the column
and column number. Most useful when the column is "$", to get
the last column of a specific line. When "lnum" or "col" is
out of range then col() returns zero.
+ With the optional {winid} argument the values are obtained for
+ that window instead of the current window.
To get the line number use |line()|. To get both use
|getpos()|.
For the screen column position use |virtcol()|. For the
@@ -1583,7 +1585,8 @@ col({expr}) The result is a Number, which is the byte index of the column
col("$") length of cursor line plus one
col("'t") column of mark t
col("'" .. markname) column of mark markname
-< The first column is 1. Returns 0 if {expr} is invalid.
+< The first column is 1. Returns 0 if {expr} is invalid or when
+ the window with ID {winid} is not found.
For an uppercase mark the column may actually be in another
buffer.
For the cursor position, when 'virtualedit' is active, the