diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-10-16 16:31:44 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-10-16 16:31:44 +0200 |
commit | a3817730c0a38ed6371b38b6db2e08547ecc674d (patch) | |
tree | 37ecfd56d68a2e4673e570357783c77624944d14 | |
parent | 1142a31b8c44c4e7dbf28a83ae52995113b37917 (diff) |
patch 8.1.2155: in a terminal window 'cursorlineopt' does not work properlyv8.1.2155
Problem: In a terminal window 'cursorlineopt' does not work properly.
Solution: Check the 'cursorlineopt' value. (closes #5055)
-rw-r--r-- | src/drawline.c | 10 | ||||
-rw-r--r-- | src/testdir/dumps/Test_terminal_normal_1.dump | 8 | ||||
-rw-r--r-- | src/testdir/dumps/Test_terminal_normal_2.dump | 8 | ||||
-rw-r--r-- | src/testdir/dumps/Test_terminal_normal_3.dump | 8 | ||||
-rw-r--r-- | src/testdir/test_terminal.vim | 27 | ||||
-rw-r--r-- | src/version.c | 2 |
6 files changed, 55 insertions, 8 deletions
diff --git a/src/drawline.c b/src/drawline.c index 4477b3f0c4..1f02eef2a4 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -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)) diff --git a/src/testdir/dumps/Test_terminal_normal_1.dump b/src/testdir/dumps/Test_terminal_normal_1.dump new file mode 100644 index 0000000000..471419a6d6 --- /dev/null +++ b/src/testdir/dumps/Test_terminal_normal_1.dump @@ -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| diff --git a/src/testdir/dumps/Test_terminal_normal_2.dump b/src/testdir/dumps/Test_terminal_normal_2.dump new file mode 100644 index 0000000000..b255d893fc --- /dev/null +++ b/src/testdir/dumps/Test_terminal_normal_2.dump @@ -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| diff --git a/src/testdir/dumps/Test_terminal_normal_3.dump b/src/testdir/dumps/Test_terminal_normal_3.dump new file mode 100644 index 0000000000..aa82fe8598 --- /dev/null +++ b/src/testdir/dumps/Test_terminal_normal_3.dump @@ -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| diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 7e8ef763b4..383dfedf71 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -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 diff --git a/src/version.c b/src/version.c index 165756a298..6de34d4712 100644 --- a/src/version.c +++ b/src/version.c @@ -754,6 +754,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2155, +/**/ 2154, /**/ 2153, |