]> granicus.if.org Git - vim/commitdiff
patch 9.0.0662: concealed characters do not work correctly v9.0.0662
authorBram Moolenaar <Bram@vim.org>
Tue, 4 Oct 2022 21:40:56 +0000 (22:40 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 4 Oct 2022 21:40:56 +0000 (22:40 +0100)
Problem:    Concealed characters do not work correctly.
Solution:   Subtract boguscols instead of adding them. (closes #11273)

src/drawline.c
src/testdir/dumps/Test_conceal_linebreak_1.dump [new file with mode: 0644]
src/testdir/test_conceal.vim
src/version.c

index 3e796d23e2b4731be1d61eab78639e0158dbef65..018a6d8c5f036d518ebde55644b7c1fd582f36b9 100644 (file)
@@ -3689,9 +3689,9 @@ win_line(
                )
        {
 #ifdef FEAT_CONCEAL
-           wlv.col += wlv.boguscols;
-           wlv_screen_line(wp, &wlv, FALSE);
            wlv.col -= wlv.boguscols;
+           wlv_screen_line(wp, &wlv, FALSE);
+           wlv.col += wlv.boguscols;
            wlv.boguscols = 0;
 #else
            wlv_screen_line(wp, &wlv, FALSE);
diff --git a/src/testdir/dumps/Test_conceal_linebreak_1.dump b/src/testdir/dumps/Test_conceal_linebreak_1.dump
new file mode 100644 (file)
index 0000000..8c93df0
--- /dev/null
@@ -0,0 +1,8 @@
+>x+0&#ffffff0@74
+| @74
+|a@63| @10
+|++0#4040ff13&| |b+0#0000000&@66| @5
+|++0#4040ff13&| |c+0#0000000&@5| @66
+|~+0#4040ff13&| @73
+|~| @73
+| +0#0000000&@56|1|,|1| @10|A|l@1| 
index c0a46dc6b7e86a12546452cbe43fe11d8491a533..385d42b5448e457e9ac56cab67ba6399e0c158f3 100644 (file)
@@ -159,6 +159,32 @@ func Test_conceal_resize_term()
   call StopVimInTerminal(buf)
 endfunc
 
+func Test_conceal_linebreak()
+  CheckScreendump
+
+  let code =<< trim [CODE]
+      vim9script
+      &wrap = true
+      &conceallevel = 2
+      &concealcursor = 'nc'
+      &linebreak = true
+      &showbreak = '+ '
+      var line: string = 'a`a`a`a`'
+          .. 'a'->repeat(&columns - 15)
+          .. ' b`b`'
+          .. 'b'->repeat(&columns - 10)
+          .. ' cccccc'
+      ['x'->repeat(&columns), '', line]->setline(1)
+      syntax region CodeSpan matchgroup=Delimiter start=/\z(`\+\)/ end=/\z1/ concealends
+  [CODE]
+  call writefile(code, 'XTest_conceal_linebreak', 'D')
+  let buf = RunVimInTerminal('-S XTest_conceal_linebreak', {'rows': 8})
+  call VerifyScreenDump(buf, 'Test_conceal_linebreak_1', {})
+
+  " clean up
+  call StopVimInTerminal(buf)
+endfunc
+
 " Tests for correct display (cursor column position) with +conceal and
 " tabulators.  Need to run this test in a separate Vim instance. Otherwise the
 " screen is not updated (lazy redraw) and the cursor position is wrong.
index e9cc0ec3b49287c79accfff2e44daddf8a3ca84c..540ea3713a21d7bb97ae0cb09654c202d223667f 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    662,
 /**/
     661,
 /**/