]> granicus.if.org Git - vim/commitdiff
patch 8.1.2031: cursor position wrong when resizing and using conceal v8.1.2031
authorBram Moolenaar <Bram@vim.org>
Sat, 14 Sep 2019 19:55:51 +0000 (21:55 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 14 Sep 2019 19:55:51 +0000 (21:55 +0200)
Problem:    Cursor position wrong when resizing and using conceal.
Solution:   Set the flags that the cursor position is valid when setting the
            row and column during redrawing. (closes #4931)

src/screen.c
src/testdir/dumps/Test_conceal_resize_01.dump [new file with mode: 0644]
src/testdir/dumps/Test_conceal_resize_02.dump [new file with mode: 0644]
src/testdir/test_conceal.vim
src/version.c

index 4ea0cffbd7b6d180c1818f878e41bd15c98985e1..fec1081c261c69b022162c21606d8d107bc40bc8 100644 (file)
@@ -5374,6 +5374,7 @@ win_line(
                wp->w_wcol = col - boguscols;
            wp->w_wrow = row;
            did_wcol = TRUE;
+           curwin->w_valid |= VALID_WCOL|VALID_WROW|VALID_VIRTCOL;
        }
 #endif
 
diff --git a/src/testdir/dumps/Test_conceal_resize_01.dump b/src/testdir/dumps/Test_conceal_resize_01.dump
new file mode 100644 (file)
index 0000000..8bb9c38
--- /dev/null
@@ -0,0 +1,6 @@
+|o+0&#ffffff0|n|e| |t|w|o| |t|h|r|e@1| |f|o|u|r| |f|i|v|e|,| |t|h|e| >b|a|c|k|t|i|c|k|s| |s|h|o|u|l|d| |b|e| |c|o|n|c|e|a|l|e|d| @16
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|,|4|0| @9|A|l@1| 
diff --git a/src/testdir/dumps/Test_conceal_resize_02.dump b/src/testdir/dumps/Test_conceal_resize_02.dump
new file mode 100644 (file)
index 0000000..876a8ec
--- /dev/null
@@ -0,0 +1,7 @@
+|o+0&#ffffff0|n|e| |t|w|o| |t|h|r|e@1| |f|o|u|r| |f|i|v|e|,| |t|h|e| >b|a|c|k|t|i|c|k|s| |s|h|o|u|l|d| |b|e| |c|o|n|c|e|a|l|e|d| @16
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|,|4|0| @9|A|l@1| 
index 6b9524263d838e90e4bd281c342c6af38f002f3e..bec21643b370d3dfdc42d2382ace1378025454d5 100644 (file)
@@ -135,3 +135,23 @@ func Test_conceal_with_cursorline()
   call StopVimInTerminal(buf)
   call delete('XTest_conceal_cul')
 endfunc
+
+func Test_conceal_resize_term()
+  let code =<< trim [CODE]
+    call setline(1, '`one` `two` `three` `four` `five`, the backticks should be concealed')
+    setl cocu=n cole=3
+    syn region CommentCodeSpan matchgroup=Comment start=/`/ end=/`/ concealends
+    normal fb
+  [CODE]
+  call writefile(code, 'XTest_conceal_resize')
+  let buf = RunVimInTerminal('-S XTest_conceal_resize', {'rows': 6})
+  call VerifyScreenDump(buf, 'Test_conceal_resize_01', {})
+
+  call win_execute(buf->win_findbuf()[0], 'wincmd +')
+  call term_wait(buf)
+  call VerifyScreenDump(buf, 'Test_conceal_resize_02', {})
+
+  " clean up
+  call StopVimInTerminal(buf)
+  call delete('XTest_conceal_resize')
+endfunc
index c7f8764137eb5a1be9fa2f0a4c6c9d9513bc9d5d..61e41bd60bc5b039e49efc231128281a4f4f12ff 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2031,
 /**/
     2030,
 /**/