diff --git a/src/edit.c b/src/edit.c index 0edd38be4c..a183324b35 100644 --- a/src/edit.c +++ b/src/edit.c @@ -1058,6 +1058,10 @@ doESCkey: case K_COMMAND: // command case K_SCRIPT_COMMAND: // command 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. diff --git a/src/normal.c b/src/normal.c index e39fb772ae..49e5a93b1d 100644 --- 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); } diff --git a/src/testdir/dumps/Test_cursorline_screenline_1.dump b/src/testdir/dumps/Test_cursorline_screenline_1.dump new file mode 100644 index 0000000000..d28794bb77 --- /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| diff --git a/src/testdir/dumps/Test_cursorline_screenline_2.dump b/src/testdir/dumps/Test_cursorline_screenline_2.dump new file mode 100644 index 0000000000..3c44da1fff --- /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| diff --git a/src/testdir/test_cursorline.vim b/src/testdir/test_cursorline.vim index c2505e3d58..7797cd6280 100644 --- 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 call cursor(1, 1) + 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, "\") + call VerifyScreenDump(buf, 'Test_cursorline_screenline_2', {}) + call term_sendkeys(buf, "\") + + call StopVimInTerminal(buf) + call delete('Xcul_screenline') +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index a68c88137b..5eb4eea1e5 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 4630, /**/ 4629, /**/