changeset 15476:5b0f37d844b3 v8.1.0746

patch 8.1.0746: highlighting not updated with conceal and 'cursorline' commit https://github.com/vim/vim/commit/bbee8d5122b159683b3f52eddd0da85fcf1fcbfd Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 14 21:51:40 2019 +0100 patch 8.1.0746: highlighting not updated with conceal and 'cursorline' Problem: Highlighting not updated with conceal and 'cursorline'. (Jason Franklin) Solution: Do not use a zero line number. Check if 'conceallevel' is set for the current window.
author Bram Moolenaar <Bram@vim.org>
date Mon, 14 Jan 2019 22:00:06 +0100
parents a695c188f6ca
children 78ab210dc537
files src/main.c src/testdir/dumps/Test_conceal_cul_01.dump src/testdir/dumps/Test_conceal_cul_02.dump src/testdir/dumps/Test_conceal_cul_03.dump src/testdir/test_conceal.vim src/version.c
diffstat 6 files changed, 92 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.c
+++ b/src/main.c
@@ -1170,6 +1170,10 @@ main_loop(
 	    // locked, this would be a good time to handle the drop.
 	    handle_any_postponed_drop();
 #endif
+#ifdef FEAT_CONCEAL
+	    if (curwin->w_p_cole == 0)
+		conceal_update_lines = FALSE;
+#endif
 
 	    /* Trigger CursorMoved if the cursor moved. */
 	    if (!finish_op && (
@@ -1201,6 +1205,7 @@ main_loop(
 			|| need_cursor_line_redraw))
 	    {
 		if (conceal_old_cursor_line != conceal_new_cursor_line
+			&& conceal_old_cursor_line != 0
 			&& conceal_old_cursor_line
 						<= curbuf->b_ml.ml_line_count)
 		    redrawWinline(curwin, conceal_old_cursor_line);
new file mode 100644
--- /dev/null
+++ b/src/testdir/dumps/Test_conceal_cul_01.dump
@@ -0,0 +1,20 @@
+|o+0&#ffffff0|n|e| @71
+|t|w|o| @71
+>t+8&&|h|r|e@1| @69
+|f+0&&|o|u|r| @70
+|f|i|v|e| @70
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|3|,|1| @11|A|l@1
+| +0&&@74
+|t+8&&|h|i|s| |i|s| |a| |t|e|s|t| @60
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|[+1#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|2|,|1|4| @10|A|l@1
+| +0&&@74
new file mode 100644
--- /dev/null
+++ b/src/testdir/dumps/Test_conceal_cul_02.dump
@@ -0,0 +1,20 @@
+|o+0&#ffffff0|n|e| @71
+|t|w|o| @71
+|t+8&&|h|r|e@1| @69
+|f+0&&|o|u|r| @70
+|f|i|v|e| @70
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|[+1#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|3|,|1| @11|A|l@1
+| +0&&@74
+|t+8&&|h|i|s| |i|s| |a| |t|e|s>t| @60
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|2|,|1|4| @10|A|l@1
+|:+0&&|w|i|n|c|m|d| |w| @65
new file mode 100644
--- /dev/null
+++ b/src/testdir/dumps/Test_conceal_cul_03.dump
@@ -0,0 +1,20 @@
+|o+0&#ffffff0|n|e| @71
+|t|w|o| @71
+|t+8&&|h|r|e@1| @69
+|f+0&&|o|u|r| @70
+|f|i|v|e| @70
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|[+1#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|3|,|1| @11|A|l@1
+> +8&&@74
+|t+0&&|h|i|s| |i|s| |a| |t|e|s|t| @60
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1|,|0|-|1| @9|A|l@1
+|:+0&&|w|i|n|c|m|d| |w| @65
--- a/src/testdir/test_conceal.vim
+++ b/src/testdir/test_conceal.vim
@@ -109,3 +109,28 @@ func Test_conceal_two_windows()
   call StopVimInTerminal(buf)
   call delete('XTest_conceal')
 endfunc
+
+func Test_conceal_with_cursorline()
+  " Opens a help window, where 'conceal' is set, switches to the other window
+  " where 'cursorline' needs to be updated when the cursor moves.
+  call writefile([
+	\ 'set cursorline',
+	\ 'normal othis is a test',
+	\ 'new',
+	\ 'call setline(1, ["one", "two", "three", "four", "five"])',
+	\ 'set ft=help',
+	\ 'normal M',
+	\ ], 'XTest_conceal_cul')
+  let buf = RunVimInTerminal('-S XTest_conceal_cul', {})
+  call VerifyScreenDump(buf, 'Test_conceal_cul_01', {})
+
+  call term_sendkeys(buf, ":wincmd w\r")
+  call VerifyScreenDump(buf, 'Test_conceal_cul_02', {})
+
+  call term_sendkeys(buf, "k")
+  call VerifyScreenDump(buf, 'Test_conceal_cul_03', {})
+
+  " clean up
+  call StopVimInTerminal(buf)
+  call delete('XTest_conceal_cul')
+endfunc
--- a/src/version.c
+++ b/src/version.c
@@ -796,6 +796,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    746,
+/**/
     745,
 /**/
     744,