diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-01-17 06:24:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-17 06:24:52 +0800 |
commit | 9ccc6de8d3ebfec0aebdc6dabdb23dd43f102331 (patch) | |
tree | 94addadacb9161dd4d8f43d5f6a34226a9fed27f /runtime | |
parent | 1484995a1e5ab29010878fa5ee27c935fec6522f (diff) | |
parent | 54470336ff3ae1cf32daa2815267fe837aff0281 (diff) | |
download | rneovim-9ccc6de8d3ebfec0aebdc6dabdb23dd43f102331.tar.gz rneovim-9ccc6de8d3ebfec0aebdc6dabdb23dd43f102331.tar.bz2 rneovim-9ccc6de8d3ebfec0aebdc6dabdb23dd43f102331.zip |
Merge pull request #21768 from luukvbaal/test-virtline
fix(column)!: ensure 'statuscolumn' works with virtual and wrapped lines
BREAKING CHANGE: In 'statuscolumn' evaluation, `v:wrap` has been
replaced by `v:virtnum`. `v:virtnum` is negative when drawing
virtual lines, zero when drawing the actual buffer line, and
positive when drawing the wrapped part of a buffer line.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 12 | ||||
-rw-r--r-- | runtime/doc/options.txt | 15 |
2 files changed, 16 insertions, 11 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 6feb5cbb49..0ac8152144 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2295,13 +2295,15 @@ v:version Vim version number: major version times 100 plus minor :if has("nvim-0.2.1") < - *v:vim_did_enter* *vim_did_enter-variable* -v:vim_did_enter 0 during startup, 1 just before |VimEnter|. + *v:virtnum* *virtnum-variable* +v:virtnum Virtual line number for the 'statuscolumn' expression. + Negative when drawing the status column for virtual lines, zero + when drawing an actual buffer line, and positive when drawing + the wrapped part of a buffer line. Read-only. - *v:wrap* *wrap-variable* -v:wrap Boolean indicating whether 'statuscolumn' is being evaluated - for the wrapped part of a line. + *v:vim_did_enter* *vim_did_enter-variable* +v:vim_did_enter 0 during startup, 1 just before |VimEnter|. Read-only. *v:warningmsg* *warningmsg-variable* diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 4498dda300..efeeba983e 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -6017,12 +6017,15 @@ A jump table for the options with a short description can be found at |Q_op|. %s sign column for currently drawn line %C fold column for currently drawn line - To draw the sign and fold columns, they must be included in - 'statuscolumn'. + NOTE: To draw the sign and fold columns, their items must be included in + 'statuscolumn'. Even when they are not included, the status column width + will adapt to the 'signcolumn' and 'foldcolumn' width. - The |v:lnum| variable holds the line number to be drawn. - The |v:relnum| variable holds the relative line number to be drawn. - The |v:wrap| variable holds true for the wrapped part of a line. + The |v:lnum| variable holds the line number to be drawn. + The |v:relnum| variable holds the relative line number to be drawn. + The |v:virtnum| variable is negative when drawing virtual lines, zero + when drawing the actual buffer line, and positive when + drawing the wrapped part of a buffer line. Examples: >vim " Relative number with bar separator and click handlers: @@ -6032,7 +6035,7 @@ A jump table for the options with a short description can be found at |Q_op|. :let &stc='%=%{v:relnum?v:relnum:v:lnum} ' " Line numbers in hexadecimal for non wrapped part of lines: - :let &stc='%=%{v:wrap?"":printf("%x",v:lnum)} ' + :let &stc='%=%{v:virtnum>0?"":printf("%x",v:lnum)} ' " Human readable line numbers with thousands separator: :let &stc='%{substitute(v:lnum,"\\d\\zs\\ze\\' |