From 6ba152168787e2cf7d197d8f2d682daaca0c94cf Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 14 Jun 2024 04:45:12 +0800 Subject: vim-patch:d353d27: runtime(doc): restore description of "$" in col() and virtcol() (vim/vim#14981) These are different from line() and getpos(). https://github.com/vim/vim/commit/d353d2782032b91498601afefee4256592f48074 --- src/nvim/eval.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/nvim') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 65f599b213..93a2bce2a5 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -1240,6 +1240,8 @@ M.funcs = { 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 @@ -4144,7 +4146,7 @@ M.funcs = { . 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 @@ -4194,8 +4196,8 @@ M.funcs = { let save_a_mark = getpos("'a") " ... call setpos("'a", save_a_mark) - -