summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-09-14 21:55:51 +0200
committerBram Moolenaar <Bram@vim.org>2019-09-14 21:55:51 +0200
commit5babc6e858afbfa54aa0e203a64b9c70175487b7 (patch)
treeb6fe7ec5b3a424219c9eacf193908b2095eea1ec
parent997d42427eaab889058eb047e08d55de9e4a968a (diff)
downloadvim-git-5babc6e858afbfa54aa0e203a64b9c70175487b7.tar.gz
patch 8.1.2031: cursor position wrong when resizing and using concealv8.1.2031
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)
-rw-r--r--src/screen.c1
-rw-r--r--src/testdir/dumps/Test_conceal_resize_01.dump6
-rw-r--r--src/testdir/dumps/Test_conceal_resize_02.dump7
-rw-r--r--src/testdir/test_conceal.vim20
-rw-r--r--src/version.c2
5 files changed, 36 insertions, 0 deletions
diff --git a/src/screen.c b/src/screen.c
index 4ea0cffbd..fec1081c2 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -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
index 000000000..8bb9c38ea
--- /dev/null
+++ b/src/testdir/dumps/Test_conceal_resize_01.dump
@@ -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
index 000000000..876a8eceb
--- /dev/null
+++ b/src/testdir/dumps/Test_conceal_resize_02.dump
@@ -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|
diff --git a/src/testdir/test_conceal.vim b/src/testdir/test_conceal.vim
index 6b9524263..bec21643b 100644
--- a/src/testdir/test_conceal.vim
+++ b/src/testdir/test_conceal.vim
@@ -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
diff --git a/src/version.c b/src/version.c
index c7f876413..61e41bd60 100644
--- a/src/version.c
+++ b/src/version.c
@@ -758,6 +758,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2031,
+/**/
2030,
/**/
2029,