forked from aniani/vim
patch 9.0.0863: col() and charcol() only work for the current window
Problem: col() and charcol() only work for the current window.
Solution: Add an optional winid argument. (Yegappan Lakshmanan,
closes #11466, closes #11461)
This commit is contained in:
committed by
Bram Moolenaar
parent
0aad88f073
commit
4c8d2f02b3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user