summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authornaohiro ono <obcat@icloud.com>2022-01-01 14:59:44 +0000
committerBram Moolenaar <Bram@vim.org>2022-01-01 14:59:44 +0000
commit56200eed62e59ad831f6564dcafe346e6f97ac20 (patch)
treebd242d2ea39d37c41f17bfa82acec695dac1d6b4 /runtime
parente70cec976026ce72d09b6589ebba4677581063ac (diff)
downloadvim-git-56200eed62e59ad831f6564dcafe346e6f97ac20.tar.gz
patch 8.2.3969: value of MAXCOL not available in Vim scriptv8.2.3969
Problem: Value of MAXCOL not available in Vim script. Solution: Add v:maxcol. (Naohiro Ono, closes #9451)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/builtin.txt23
-rw-r--r--runtime/doc/eval.txt3
2 files changed, 17 insertions, 9 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index a6b8e3163..8d2cc5edc 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -2480,7 +2480,7 @@ filter({expr1}, {expr2}) *filter()*
:let l = filter(copy(mylist), 'v:val =~ "KEEP"')
< Returns {expr1}, the |List| or |Dictionary| that was filtered,
- or a new |Blob| or |String|.
+ or a new |Blob| or |String|.
When an error is encountered while evaluating {expr2} no
further items in {expr1} are processed.
When {expr2} is a Funcref errors inside a function are ignored,
@@ -3128,8 +3128,8 @@ getcharpos({expr})
Get the position for String {expr}. Same as |getpos()| but the
column number in the returned List is a character index
instead of a byte index.
- If |getpos()| returns a very large column number, such as
- 2147483647, then getcharpos() will return the character index
+ If |getpos()| returns a very large column number, equal to
+ |v:maxcol|, then getcharpos() will return the character index
of the last character.
Example:
@@ -3279,7 +3279,8 @@ getcurpos([{winid}])
includes an extra "curswant" item in the list:
[0, lnum, col, off, curswant] ~
The "curswant" number is the preferred column when moving the
- cursor vertically. Also see |getcursorcharpos()| and
+ cursor vertically. After |$| command it will be a very large
+ number equal to |v:maxcol|. Also see |getcursorcharpos()| and
|getpos()|.
The first "bufnum" item is always zero. The byte position of
the cursor is returned in 'col'. To get the character
@@ -3624,12 +3625,12 @@ getpos({expr}) Get the position for String {expr}. For possible values of
character.
Note that for '< and '> Visual mode matters: when it is "V"
(visual line mode) the column of '< is zero and the column of
- '> is a large number.
+ '> is a large number equal to |v:maxcol|.
The column number in the returned List is the byte position
within the line. To get the character position in the line,
use |getcharpos()|.
- The column number can be very large, e.g. 2147483647, in which
- case it means "after the end of the line".
+ A very large column number equal to |v:maxcol| can be returned,
+ in which case it means "after the end of the line".
This can be used to save and restore the position of a mark: >
let save_a_mark = getpos("'a")
...
@@ -9748,10 +9749,14 @@ winsaveview() Returns a |Dictionary| that contains information to restore
The return value includes:
lnum cursor line number
col cursor column (Note: the first column
- zero, as opposed to what getpos()
+ zero, as opposed to what |getcurpos()|
returns)
coladd cursor column offset for 'virtualedit'
- curswant column for vertical movement
+ curswant column for vertical movement (Note:
+ the first column is zero, as opposed
+ to what |getcurpos()| returns). After
+ |$| command it will be a very large
+ number equal to |v:maxcol|.
topline first line in the window
topfill filler lines, only in diff mode
leftcol first column displayed; only used when
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 383920718..dca886e85 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2161,6 +2161,9 @@ v:lnum Line number for the 'foldexpr' |fold-expr|, 'formatexpr' and
expressions is being evaluated. Read-only when in the
|sandbox|.
+ *v:maxcol* *maxcol-variable*
+v:maxcol Maximum line length.
+
*v:mouse_win* *mouse_win-variable*
v:mouse_win Window number for a mouse click obtained with |getchar()|.
First window has number 1, like with |winnr()|. The value is