changeset 28209:cbaac8434e4a v8.2.4630

patch 8.2.4630: 'cursorline' not always updated with 'culopt' is "screenline" Commit: https://github.com/vim/vim/commit/bf269ed0b0bd8414eea7bea17465b2738a9a2b55 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 26 13:28:14 2022 +0000 patch 8.2.4630: 'cursorline' not always updated with 'culopt' is "screenline" Problem: 'cursorline' not always updated with 'cursorlineopt' is "screenline". Solution: Call check_redraw_cursorline() more often. (closes #10013)
author Bram Moolenaar <Bram@vim.org>
date Sat, 26 Mar 2022 14:30:03 +0100
parents 92e7aeb97a55
children afc77faada78
files src/edit.c src/normal.c src/testdir/dumps/Test_cursorline_screenline_1.dump src/testdir/dumps/Test_cursorline_screenline_2.dump src/testdir/test_cursorline.vim src/version.c
diffstat 6 files changed, 47 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/edit.c
+++ b/src/edit.c
@@ -1058,6 +1058,10 @@ doESCkey:
 	case K_COMMAND:		    // <Cmd>command<CR>
 	case K_SCRIPT_COMMAND:	    // <ScriptCmd>command<CR>
 	    do_cmdkey_command(c, 0);
+#ifdef FEAT_SYN_HL
+	    // Might need to update for 'cursorline'.
+	    check_redraw_cursorline();
+#endif
 #ifdef FEAT_TERMINAL
 	    if (term_use_loop())
 		// Started a terminal that gets the input, exit Insert mode.
--- a/src/normal.c
+++ b/src/normal.c
@@ -6971,6 +6971,10 @@ nv_edit(cmdarg_T *cap)
 	    coladvance(getviscol());
 	    State = save_State;
 	}
+#ifdef FEAT_SYN_HL
+	// Might need to update for 'cursorline'.
+	check_redraw_cursorline();
+#endif
 
 	invoke_edit(cap, FALSE, cap->cmdchar, FALSE);
     }
new file mode 100644
--- /dev/null
+++ b/src/testdir/dumps/Test_cursorline_screenline_1.dump
@@ -0,0 +1,8 @@
+|x+0&#ffffff0|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z
+| +8&&|x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| > @29
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|1|2|1| @8|A|l@1| 
new file mode 100644
--- /dev/null
+++ b/src/testdir/dumps/Test_cursorline_screenline_2.dump
@@ -0,0 +1,8 @@
+>x+8&#ffffff0|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z
+| +0&&|x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| |x|y|z| @30
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|1| @10|A|l@1| 
--- a/src/testdir/test_cursorline.vim
+++ b/src/testdir/test_cursorline.vim
@@ -272,5 +272,26 @@ func Test_cursorline_callback()
   call delete('Xcul_timer')
 endfunc
 
+func Test_cursorline_screenline_update()
+  CheckScreendump
+
+  let lines =<< trim END
+      call setline(1, repeat('xyz ', 30))
+      set cursorline cursorlineopt=screenline
+      inoremap <F2> <Cmd>call cursor(1, 1)<CR>
+  END
+  call writefile(lines, 'Xcul_screenline')
+
+  let buf = RunVimInTerminal('-S Xcul_screenline', #{rows: 8})
+  call term_sendkeys(buf, "A")
+  call VerifyScreenDump(buf, 'Test_cursorline_screenline_1', {})
+  call term_sendkeys(buf, "\<F2>")
+  call VerifyScreenDump(buf, 'Test_cursorline_screenline_2', {})
+  call term_sendkeys(buf, "\<Esc>")
+
+  call StopVimInTerminal(buf)
+  call delete('Xcul_screenline')
+endfunc
+
 
 " vim: shiftwidth=2 sts=2 expandtab
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    4630,
+/**/
     4629,
 /**/
     4628,