summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Radkov <alexey.radkov@gmail.com>2023-01-04 11:15:30 +0000
committerBram Moolenaar <Bram@vim.org>2023-01-04 11:15:30 +0000
commitaaa16b09180080284c4a5049fe16bdaccbb13b74 (patch)
treebc12b729a1f396eef330eee294760ede70f309f0
parent574950dfb1d353f094463b709e39544ebf8fcdcd (diff)
downloadvim-git-aaa16b09180080284c4a5049fe16bdaccbb13b74.tar.gz
patch 9.0.1141: 'cursorcolumn' and 'colorcolumn' wrong after concealingv9.0.1141
Problem: 'cursorcolumn' and 'colorcolumn' wrong after concealing and wrapping line. Solution: Reset "wlv.vcol_off" after each screen line. (Alexey Radkov, closes #11777)
-rw-r--r--src/drawline.c1
-rw-r--r--src/testdir/dumps/Test_conceal_cuc_01.dump10
-rw-r--r--src/testdir/dumps/Test_conceal_cuc_02.dump10
-rw-r--r--src/testdir/test_conceal.vim32
-rw-r--r--src/version.c2
5 files changed, 55 insertions, 0 deletions
diff --git a/src/drawline.c b/src/drawline.c
index 11cfb7782..a82a5e49f 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -3893,6 +3893,7 @@ win_line(
wlv_screen_line(wp, &wlv, FALSE);
wlv.col += wlv.boguscols;
wlv.boguscols = 0;
+ wlv.vcol_off = 0;
#else
wlv_screen_line(wp, &wlv, FALSE);
#endif
diff --git a/src/testdir/dumps/Test_conceal_cuc_01.dump b/src/testdir/dumps/Test_conceal_cuc_01.dump
new file mode 100644
index 000000000..bf4281999
--- /dev/null
+++ b/src/testdir/dumps/Test_conceal_cuc_01.dump
@@ -0,0 +1,10 @@
+|o+0&#ffffff0|n|e| |o|n|e| |o|n|e| @1|o|n|e| |o|n|e| |o|n|e| |o+0&#e0e0e08|n+0&#ffffff0|e| @11
+| +0#4040ff13&|>@2| |o+0#0000000&|n|e| |o+0&#ffd7d7255|n+0&#ffffff0|e| |o|n|e| |o|n|e| @19
+|t|w|o| |t|w|o| |t|w|o| |t|w|o| |||h|i|d@1|e|n||| >h|e|r|e| |t|w|o| |t|w|o| @2
+|t|h|r|e@1| @1|t|h|r|e@1| |t|h|r|e@1| |t|h|r|e@1| |t+0&#e0e0e08|h+0&#ffffff0|r|e@1| @9
+| +0#4040ff13&|>@2| |t+0#0000000&|h|r|e|e+0&#ffd7d7255| +0&#ffffff0|t|h|r|e@1| |t|h|r|e@1| |t|h|r|e@1| @11
+|~+0#4040ff13&| @38
+|~| @38
+|~| @38
+|~| @38
+|/+0#0000000&|h|e|r|e| @16|2|,|2|6| @9|A|l@1|
diff --git a/src/testdir/dumps/Test_conceal_cuc_02.dump b/src/testdir/dumps/Test_conceal_cuc_02.dump
new file mode 100644
index 000000000..1b6662e98
--- /dev/null
+++ b/src/testdir/dumps/Test_conceal_cuc_02.dump
@@ -0,0 +1,10 @@
+|o+0&#ffffff0|n|e| |o|n|e| |o|n|e| @1|o|n|e| |o|n|e| |o|n|e| |o|n|e| @11
+| +0#4040ff13&|>@2| |o+0#0000000&|n|e| |o+0&#ffd7d7255|n+0&#ffffff0|e| |o|n|e| |o|n|e| @19
+|t|w|o| |t|w|o| |t|w|o| |t|w|o| |||h|i|d@1|e|n||| |h|e|r|e| |t|w|o| |t|w>o| @2
+|t|h|r|e@1| @1|t|h|r|e@1| |t|h|r|e@1| |t|h|r|e@1| |t|h|r|e@1| @9
+| +0#4040ff13&|>@2| |t+0#0000000&|h|r|e|e+0&#ffd7d7255| +0&#ffffff0|t|h|r|e@1| |t|h|r|e@1| |t|h|r|e@1| @11
+|~+0#4040ff13&| @38
+|~| @38
+|~| @38
+|~| @38
+|/+0#0000000&|h|e|r|e| @16|2|,|3|7| @9|A|l@1|
diff --git a/src/testdir/test_conceal.vim b/src/testdir/test_conceal.vim
index 385d42b54..d9a764411 100644
--- a/src/testdir/test_conceal.vim
+++ b/src/testdir/test_conceal.vim
@@ -139,6 +139,38 @@ func Test_conceal_with_cursorline()
call StopVimInTerminal(buf)
endfunc
+func Test_conceal_with_cursorcolumn()
+ CheckScreendump
+
+ " Check that cursorcolumn and colorcolumn don't get broken in presence of
+ " wrapped lines containing concealed text
+ let code =<< trim [CODE]
+ let lines = ["one one one |hidden| one one one one one one one one",
+ \ "two two two two |hidden| here two two",
+ \ "three |hidden| three three three three three three three three"]
+ call setline(1, lines)
+ set wrap linebreak
+ set showbreak=\ >>>\
+ syntax match test /|hidden|/ conceal
+ set conceallevel=2
+ set concealcursor=
+ exe "normal /here\r"
+ set cursorcolumn
+ set colorcolumn=50
+ [CODE]
+
+ call writefile(code, 'XTest_conceal_cuc', 'D')
+ let buf = RunVimInTerminal('-S XTest_conceal_cuc', {'rows': 10, 'cols': 40})
+ call VerifyScreenDump(buf, 'Test_conceal_cuc_01', {})
+
+ " move cursor to the end of line (the cursor jumps to the next screen line)
+ call term_sendkeys(buf, "$")
+ call VerifyScreenDump(buf, 'Test_conceal_cuc_02', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+endfunc
+
func Test_conceal_resize_term()
CheckScreendump
diff --git a/src/version.c b/src/version.c
index bc0d3fd8c..3bfa6d46f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1141,
+/**/
1140,
/**/
1139,