0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.1.2155: in a terminal window 'cursorlineopt' does not work properly

Problem:    In a terminal window 'cursorlineopt' does not work properly.
Solution:   Check the 'cursorlineopt' value. (closes #5055)
This commit is contained in:
Bram Moolenaar 2019-10-16 16:31:44 +02:00
parent 1142a31b8c
commit a3817730c0
6 changed files with 55 additions and 8 deletions

View File

@ -1401,14 +1401,7 @@ win_line(
{
#ifdef FEAT_TERMINAL
if (get_term_attr)
{
syntax_attr = term_get_attr(wp->w_buffer, lnum, vcol);
if (!attr_pri)
char_attr = syntax_attr;
else
char_attr = hl_combine_attr(syntax_attr, char_attr);
}
#endif
#ifdef FEAT_SYN_HL
@ -2295,7 +2288,8 @@ win_line(
if (win_attr != 0)
{
char_attr = win_attr;
if (wp->w_p_cul && lnum == wp->w_cursor.lnum)
if (wp->w_p_cul && lnum == wp->w_cursor.lnum
&& wp->w_p_culopt_flags != CULOPT_NBR)
{
if (!cul_screenline || (vcol >= left_curline_col
&& vcol <= right_curline_col))

View File

@ -0,0 +1,8 @@
| +0#af5f00255#ffffff0@1|1| |1+0#0000000&@4| @65
| +0#af5f00255&@1|2| |1+0#0000000&@3|2| @65
| +8#af5f00255&@1|3| >1+8#0000000&@3|3| @65
| +0#af5f00255&@1|4| |1+0#0000000&@3|4| @65
| +0#af5f00255&@1|5| |1+0#0000000&@3|5| @65
| +0#af5f00255&@1|6| |1+0#0000000&@3|6| @65
| +0#af5f00255&@1|7| |1+0#0000000&@3|7| @65
|:|s|e|t| |n|u|m|b|e|r| |c|u|r|s|o|r|l|i|n|e| |c|u|l|o|p|t|=|b|o|t|h| @22|3|,|1| @10|T|o|p|

View File

@ -0,0 +1,8 @@
| +0#af5f00255#ffffff0@1|1| |1+0#0000000&@4| @65
| +0#af5f00255&@1|2| |1+0#0000000&@3|2| @65
| +8#af5f00255&@1|3| >1+0#0000000&@3|3| @65
| +0#af5f00255&@1|4| |1+0#0000000&@3|4| @65
| +0#af5f00255&@1|5| |1+0#0000000&@3|5| @65
| +0#af5f00255&@1|6| |1+0#0000000&@3|6| @65
| +0#af5f00255&@1|7| |1+0#0000000&@3|7| @65
|:|s|e|t| |c|u|l|o|p|t|=|n|u|m|b|e|r| @38|3|,|1| @10|T|o|p|

View File

@ -0,0 +1,8 @@
| +0#af5f00255#ffffff0@1|1| |1+0#0000000&@4| @65
| +0#af5f00255&@1|2| |1+0#0000000&@3|2| @65
| +0#af5f00255&@1|3| >1+8#0000000&@3|3| @65
| +0#af5f00255&@1|4| |1+0#0000000&@3|4| @65
| +0#af5f00255&@1|5| |1+0#0000000&@3|5| @65
| +0#af5f00255&@1|6| |1+0#0000000&@3|6| @65
| +0#af5f00255&@1|7| |1+0#0000000&@3|7| @65
|:|s|e|t| |c|u|l|o|p|t|=|l|i|n|e| @40|3|,|1| @10|T|o|p|

View File

@ -1906,6 +1906,33 @@ func Test_terminal_switch_mode()
bwipe!
endfunc
func Test_terminal_normal_mode()
CheckRunVimInTerminal
" Run Vim in a terminal and open a terminal window to run Vim in.
let lines =<< trim END
call setline(1, range(11111, 11122))
3
END
call writefile(lines, 'XtermNormal')
let buf = RunVimInTerminal('-S XtermNormal', {'rows': 8})
call term_wait(buf)
call term_sendkeys(buf, "\<C-W>N")
call term_sendkeys(buf, ":set number cursorline culopt=both\r")
call VerifyScreenDump(buf, 'Test_terminal_normal_1', {})
call term_sendkeys(buf, ":set culopt=number\r")
call VerifyScreenDump(buf, 'Test_terminal_normal_2', {})
call term_sendkeys(buf, ":set culopt=line\r")
call VerifyScreenDump(buf, 'Test_terminal_normal_3', {})
call term_sendkeys(buf, "a:q!\<CR>:q\<CR>:q\<CR>")
call StopVimInTerminal(buf)
call delete('XtermNormal')
endfunc
func Test_terminal_hidden_and_close()
CheckUnix

View File

@ -753,6 +753,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2155,
/**/
2154,
/**/