]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.1209: colorcolumn not drawn after virtual text lines v9.1.1209
authorMatthias <matthias.rader@outlook.com>
Sun, 16 Mar 2025 18:27:51 +0000 (19:27 +0100)
committerChristian Brabandt <cb@256bit.org>
Sun, 16 Mar 2025 18:27:51 +0000 (19:27 +0100)
commit2c9f49b200aab6ac0e66ac8b1e52641d603c1c52
treed48556ac79d04cb0ef8bfdf6973755415ea72de5
parentab281f8b34c9d2184cae7c1f44f12e2faf8f6b16
patch 9.1.1209: colorcolumn not drawn after virtual text lines

Problem:  colorcolumn not drawn after virtual text lines
Solution: show colorcolumn on correct line with virtual text by adding
          the size of p_extra to virtual column offset (Matthias)

When a line has two or more lines of virtual text above it, the color
column used to appear on the line of the second virtual text line, while
the first virtual text line and the "real" text line did not have a
color column.

The color column for "above" virtual text is positioned by taking the
offset of the size of the virtual text lines and subtracting it from the
"virtual column" that we are in. If the result equals the color column,
this column is colored.

The "virtual column" is calculated from the beginning of the first
virtual text line and continues over the newlines up to the end of the
"real" text. However, the offset from the virtual text was reset at
every line.

Adding all those offsets together leads to the color column being placed
consistently at the line of the "real" text.

related: #12004
related: #16868
closes: #16904

Signed-off-by: Matthias <matthias.rader@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/drawline.c
src/testdir/dumps/Test_prop_multiple_lines_above_1.dump [new file with mode: 0644]
src/testdir/test_textprop.vim
src/version.c