changeset 35386:57a8e2f92efd

runtime(doc): restore description of "$" in col() and virtcol() (#14981) Commit: https://github.com/vim/vim/commit/d353d2782032b91498601afefee4256592f48074 Author: zeertzjq <zeertzjq@outlook.com> Date: Thu Jun 13 23:00:25 2024 +0800 runtime(doc): restore description of "$" in col() and virtcol() (https://github.com/vim/vim/issues/14981) These are different from line() and getpos(). Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 13 Jun 2024 17:15:05 +0200
parents c4a1643cbd0d
children f8cbcd33a3d6
files runtime/doc/builtin.txt
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1,4 +1,4 @@
-*builtin.txt*	For Vim version 9.1.  Last change: 2024 Jun 12
+*builtin.txt*	For Vim version 9.1.  Last change: 2024 Jun 13
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -1729,6 +1729,8 @@ col({expr} [, {winid}])					*col()*
 		The result is a Number, which is the byte index of the column
 		position given with {expr}.
 		For accepted positions see |getpos()|.
+		When {expr} is "$", it means the end of the cursor line, so
+		the result is the number of bytes in the cursor line plus one.
 		Additionally {expr} can be [lnum, col]: a |List| with the line
 		and column number. Most useful when the column is "$", to get
 		the last column of a specific line.  When "lnum" or "col" is
@@ -4492,7 +4494,7 @@ getpos({expr})							*getpos()*
 		    .	    The cursor position.
 		    $	    The last line in the current buffer.
 		    'x	    Position of mark x (if the mark is not set, 0 is
-			    returned).
+			    returned for all values).
 		    w0	    First line visible in current window (one if the
 			    display isn't updated, e.g. in silent Ex mode).
 		    w$	    Last line visible in current window (this is one
@@ -4542,8 +4544,8 @@ getpos({expr})							*getpos()*
 			let save_a_mark = getpos("'a")
 			...
 			call setpos("'a", save_a_mark)
-
-<		Also see |getcharpos()|, |getcurpos()| and |setpos()|.
+<
+		Also see |getcharpos()|, |getcurpos()| and |setpos()|.
 
 		Can also be used as a |method|: >
 			GetMark()->getpos()
@@ -11754,6 +11756,8 @@ virtcol({expr} [, {list} [, {winid}]])		
 		For the byte position use |col()|.
 
 		For the use of {expr} see |getpos()| and |col()|.
+		When {expr} is "$", it means the end of the cursor line, so
+		the result is the number of cells in the cursor line plus one.
 
 		When 'virtualedit' is used {expr} can be [lnum, col, off],
 		where "off" is the offset in screen columns from the start of