annotate src/testdir/test_highlight.vim @ 17437:5f71f12bdb8c

Added tag v8.1.1716 for changeset e1b5c15f5fee70aaa68aa8286030cf713a403aee
author Bram Moolenaar <Bram@vim.org>
date Fri, 19 Jul 2019 23:30:05 +0200
parents fceb0977275a
children 0da9bc55c31a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
1 " Tests for ":highlight" and highlighting.
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
2
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
3 source view_util.vim
15683
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
4 source screendump.vim
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
5
12019
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 func Test_highlight()
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 " basic test if ":highlight" doesn't crash
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 highlight
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 hi Search
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 " test setting colors.
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 " test clearing one color and all doesn't generate error or warning
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 silent! hi NewGroup term=bold cterm=italic ctermfg=DarkBlue ctermbg=Grey gui= guifg=#00ff00 guibg=Cyan
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 silent! hi Group2 term= cterm=
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 hi Group3 term=underline cterm=bold
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 let res = split(execute("hi NewGroup"), "\n")[0]
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 " filter ctermfg and ctermbg, the numbers depend on the terminal
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 let res = substitute(res, 'ctermfg=\d*', 'ctermfg=2', '')
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 let res = substitute(res, 'ctermbg=\d*', 'ctermbg=3', '')
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 call assert_equal("NewGroup xxx term=bold cterm=italic ctermfg=2 ctermbg=3",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 \ res)
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 call assert_equal("Group2 xxx cleared",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 \ split(execute("hi Group2"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 call assert_equal("Group3 xxx term=underline cterm=bold",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 \ split(execute("hi Group3"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 hi clear NewGroup
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 call assert_equal("NewGroup xxx cleared",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 \ split(execute("hi NewGroup"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 call assert_equal("Group2 xxx cleared",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 \ split(execute("hi Group2"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 hi Group2 NONE
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 call assert_equal("Group2 xxx cleared",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 \ split(execute("hi Group2"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 hi clear
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 call assert_equal("Group3 xxx cleared",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 \ split(execute("hi Group3"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 call assert_fails("hi Crash term='asdf", "E475:")
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 endfunc
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
41
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 13454
diff changeset
42 func HighlightArgs(name)
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
43 return 'hi ' . substitute(split(execute('hi ' . a:name), '\n')[0], '\<xxx\>', '', '')
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 13454
diff changeset
44 endfunc
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
45
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 13454
diff changeset
46 func IsColorable()
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
47 return has('gui_running') || str2nr(&t_Co) >= 8
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 13454
diff changeset
48 endfunc
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
49
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 13454
diff changeset
50 func HiCursorLine()
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
51 let hiCursorLine = HighlightArgs('CursorLine')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
52 if has('gui_running')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
53 let guibg = matchstr(hiCursorLine, 'guibg=\w\+')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
54 let hi_ul = 'hi CursorLine gui=underline guibg=NONE'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
55 let hi_bg = 'hi CursorLine gui=NONE ' . guibg
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
56 else
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
57 let hi_ul = 'hi CursorLine cterm=underline ctermbg=NONE'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
58 let hi_bg = 'hi CursorLine cterm=NONE ctermbg=Gray'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
59 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
60 return [hiCursorLine, hi_ul, hi_bg]
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 13454
diff changeset
61 endfunc
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
62
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 13454
diff changeset
63 func Check_lcs_eol_attrs(attrs, row, col)
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
64 let save_lcs = &lcs
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
65 set list
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
66
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
67 call assert_equal(a:attrs, ScreenAttrs(a:row, a:col)[0])
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
68
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
69 set nolist
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
70 let &lcs = save_lcs
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 13454
diff changeset
71 endfunc
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
72
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
73 func Test_highlight_eol_with_cursorline()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
74 let [hiCursorLine, hi_ul, hi_bg] = HiCursorLine()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
75
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
76 call NewWindow('topleft 5', 20)
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
77 call setline(1, 'abcd')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
78 call matchadd('Search', '\n')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
79
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
80 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
81 " 'abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
82 " ^^^^ ^^^^^ no highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
83 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
84 let attrs0 = ScreenAttrs(1, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
85 call assert_equal(repeat([attrs0[0]], 4), attrs0[0:3])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
86 call assert_equal(repeat([attrs0[0]], 5), attrs0[5:9])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
87 call assert_notequal(attrs0[0], attrs0[4])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
88
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
89 setlocal cursorline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
90
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
91 " underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
92 exe hi_ul
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
93
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
94 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
95 " 'abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
96 " ^^^^ underline
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
97 " ^ 'Search' highlight with underline
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
98 " ^^^^^ underline
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
99 let attrs = ScreenAttrs(1, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
100 call assert_equal(repeat([attrs[0]], 4), attrs[0:3])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
101 call assert_equal([attrs[4]] + repeat([attrs[5]], 5), attrs[4:9])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
102 call assert_notequal(attrs[0], attrs[4])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
103 call assert_notequal(attrs[4], attrs[5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
104 call assert_notequal(attrs0[0], attrs[0])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
105 call assert_notequal(attrs0[4], attrs[4])
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
106 call Check_lcs_eol_attrs(attrs, 1, 10)
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
107
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
108 if IsColorable()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
109 " bg-color
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
110 exe hi_bg
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
111
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
112 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
113 " 'abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
114 " ^^^^ bg-color of 'CursorLine'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
115 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
116 " ^^^^^ bg-color of 'CursorLine'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
117 let attrs = ScreenAttrs(1, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
118 call assert_equal(repeat([attrs[0]], 4), attrs[0:3])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
119 call assert_equal(repeat([attrs[5]], 5), attrs[5:9])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
120 call assert_equal(attrs0[4], attrs[4])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
121 call assert_notequal(attrs[0], attrs[4])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
122 call assert_notequal(attrs[4], attrs[5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
123 call assert_notequal(attrs0[0], attrs[0])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
124 call assert_notequal(attrs0[5], attrs[5])
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
125 call Check_lcs_eol_attrs(attrs, 1, 10)
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
126 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
127
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
128 call CloseWindow()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
129 exe hiCursorLine
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
130 endfunc
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
131
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
132 func Test_highlight_eol_with_cursorline_vertsplit()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
133 let [hiCursorLine, hi_ul, hi_bg] = HiCursorLine()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
134
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
135 call NewWindow('topleft 5', 5)
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
136 call setline(1, 'abcd')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
137 call matchadd('Search', '\n')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
138
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
139 let expected = "abcd |abcd "
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
140 let actual = ScreenLines(1, 15)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
141 call assert_equal(expected, actual)
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
142
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
143 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
144 " 'abcd |abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
145 " ^^^^ ^^^^^^^^^ no highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
146 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
147 " ^ 'VertSplit' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
148 let attrs0 = ScreenAttrs(1, 15)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
149 call assert_equal(repeat([attrs0[0]], 4), attrs0[0:3])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
150 call assert_equal(repeat([attrs0[0]], 9), attrs0[6:14])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
151 call assert_notequal(attrs0[0], attrs0[4])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
152 call assert_notequal(attrs0[0], attrs0[5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
153 call assert_notequal(attrs0[4], attrs0[5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
154
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
155 setlocal cursorline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
156
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
157 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
158 " 'abcd |abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
159 " ^^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
160 " ^ 'Search' highlight with underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
161 " ^ 'VertSplit' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
162 " ^^^^^^^^^ no highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
163
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
164 " underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
165 exe hi_ul
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
166
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
167 let actual = ScreenLines(1, 15)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
168 call assert_equal(expected, actual)
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
169
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
170 let attrs = ScreenAttrs(1, 15)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
171 call assert_equal(repeat([attrs[0]], 4), attrs[0:3])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
172 call assert_equal(repeat([attrs[6]], 9), attrs[6:14])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
173 call assert_equal(attrs0[5:14], attrs[5:14])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
174 call assert_notequal(attrs[0], attrs[4])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
175 call assert_notequal(attrs[0], attrs[5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
176 call assert_notequal(attrs[0], attrs[6])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
177 call assert_notequal(attrs[4], attrs[5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
178 call assert_notequal(attrs[5], attrs[6])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
179 call assert_notequal(attrs0[0], attrs[0])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
180 call assert_notequal(attrs0[4], attrs[4])
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
181 call Check_lcs_eol_attrs(attrs, 1, 15)
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
182
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
183 if IsColorable()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
184 " bg-color
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
185 exe hi_bg
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
186
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
187 let actual = ScreenLines(1, 15)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
188 call assert_equal(expected, actual)
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
189
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
190 let attrs = ScreenAttrs(1, 15)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
191 call assert_equal(repeat([attrs[0]], 4), attrs[0:3])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
192 call assert_equal(repeat([attrs[6]], 9), attrs[6:14])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
193 call assert_equal(attrs0[5:14], attrs[5:14])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
194 call assert_notequal(attrs[0], attrs[4])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
195 call assert_notequal(attrs[0], attrs[5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
196 call assert_notequal(attrs[0], attrs[6])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
197 call assert_notequal(attrs[4], attrs[5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
198 call assert_notequal(attrs[5], attrs[6])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
199 call assert_notequal(attrs0[0], attrs[0])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
200 call assert_equal(attrs0[4], attrs[4])
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
201 call Check_lcs_eol_attrs(attrs, 1, 15)
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
202 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
203
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
204 call CloseWindow()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
205 exe hiCursorLine
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
206 endfunc
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
207
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
208 func Test_highlight_eol_with_cursorline_rightleft()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
209 if !has('rightleft')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
210 return
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
211 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
212
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
213 let [hiCursorLine, hi_ul, hi_bg] = HiCursorLine()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
214
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
215 call NewWindow('topleft 5', 10)
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
216 setlocal rightleft
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
217 call setline(1, 'abcd')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
218 call matchadd('Search', '\n')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
219 let attrs0 = ScreenAttrs(1, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
220
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
221 setlocal cursorline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
222
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
223 " underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
224 exe hi_ul
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
225
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
226 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
227 " ' dcba'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
228 " ^^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
229 " ^ 'Search' highlight with underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
230 " ^^^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
231 let attrs = ScreenAttrs(1, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
232 call assert_equal(repeat([attrs[9]], 4), attrs[6:9])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
233 call assert_equal(repeat([attrs[4]], 5) + [attrs[5]], attrs[0:5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
234 call assert_notequal(attrs[9], attrs[5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
235 call assert_notequal(attrs[4], attrs[5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
236 call assert_notequal(attrs0[9], attrs[9])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
237 call assert_notequal(attrs0[5], attrs[5])
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
238 call Check_lcs_eol_attrs(attrs, 1, 10)
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
239
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
240 if IsColorable()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
241 " bg-color
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
242 exe hi_bg
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
243
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
244 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
245 " ' dcba'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
246 " ^^^^ bg-color of 'CursorLine'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
247 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
248 " ^^^^^ bg-color of 'CursorLine'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
249 let attrs = ScreenAttrs(1, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
250 call assert_equal(repeat([attrs[9]], 4), attrs[6:9])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
251 call assert_equal(repeat([attrs[4]], 5), attrs[0:4])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
252 call assert_equal(attrs0[5], attrs[5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
253 call assert_notequal(attrs[9], attrs[5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
254 call assert_notequal(attrs[5], attrs[4])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
255 call assert_notequal(attrs0[9], attrs[9])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
256 call assert_notequal(attrs0[4], attrs[4])
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
257 call Check_lcs_eol_attrs(attrs, 1, 10)
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
258 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
259
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
260 call CloseWindow()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
261 exe hiCursorLine
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
262 endfunc
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
263
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
264 func Test_highlight_eol_with_cursorline_linewrap()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
265 let [hiCursorLine, hi_ul, hi_bg] = HiCursorLine()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
266
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
267 call NewWindow('topleft 5', 10)
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
268 call setline(1, [repeat('a', 51) . 'bcd', ''])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
269 call matchadd('Search', '\n')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
270
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
271 setlocal wrap
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
272 normal! gg$
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
273 let attrs0 = ScreenAttrs(5, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
274 setlocal cursorline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
275
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
276 " underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
277 exe hi_ul
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
278
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
279 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
280 " 'abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
281 " ^^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
282 " ^ 'Search' highlight with underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
283 " ^^^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
284 let attrs = ScreenAttrs(5, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
285 call assert_equal(repeat([attrs[0]], 4), attrs[0:3])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
286 call assert_equal([attrs[4]] + repeat([attrs[5]], 5), attrs[4:9])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
287 call assert_notequal(attrs[0], attrs[4])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
288 call assert_notequal(attrs[4], attrs[5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
289 call assert_notequal(attrs0[0], attrs[0])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
290 call assert_notequal(attrs0[4], attrs[4])
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
291 call Check_lcs_eol_attrs(attrs, 5, 10)
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
292
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
293 if IsColorable()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
294 " bg-color
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
295 exe hi_bg
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
296
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
297 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
298 " 'abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
299 " ^^^^ bg-color of 'CursorLine'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
300 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
301 " ^^^^^ bg-color of 'CursorLine'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
302 let attrs = ScreenAttrs(5, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
303 call assert_equal(repeat([attrs[0]], 4), attrs[0:3])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
304 call assert_equal(repeat([attrs[5]], 5), attrs[5:9])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
305 call assert_equal(attrs0[4], attrs[4])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
306 call assert_notequal(attrs[0], attrs[4])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
307 call assert_notequal(attrs[4], attrs[5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
308 call assert_notequal(attrs0[0], attrs[0])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
309 call assert_notequal(attrs0[5], attrs[5])
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
310 call Check_lcs_eol_attrs(attrs, 5, 10)
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
311 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
312
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
313 setlocal nocursorline nowrap
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
314 normal! gg$
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
315 let attrs0 = ScreenAttrs(1, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
316 setlocal cursorline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
317
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
318 " underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
319 exe hi_ul
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
320
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
321 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
322 " 'aaabcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
323 " ^^^^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
324 " ^ 'Search' highlight with underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
325 " ^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
326 let attrs = ScreenAttrs(1, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
327 call assert_equal(repeat([attrs[0]], 6), attrs[0:5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
328 call assert_equal([attrs[6]] + repeat([attrs[7]], 3), attrs[6:9])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
329 call assert_notequal(attrs[0], attrs[6])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
330 call assert_notequal(attrs[6], attrs[7])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
331 call assert_notequal(attrs0[0], attrs[0])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
332 call assert_notequal(attrs0[6], attrs[6])
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
333 call Check_lcs_eol_attrs(attrs, 1, 10)
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
334
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
335 if IsColorable()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
336 " bg-color
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
337 exe hi_bg
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
338
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
339 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
340 " 'aaabcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
341 " ^^^^^^ bg-color of 'CursorLine'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
342 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
343 " ^^^ bg-color of 'CursorLine'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
344 let attrs = ScreenAttrs(1, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
345 call assert_equal(repeat([attrs[0]], 6), attrs[0:5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
346 call assert_equal(repeat([attrs[7]], 3), attrs[7:9])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
347 call assert_equal(attrs0[6], attrs[6])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
348 call assert_notequal(attrs[0], attrs[6])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
349 call assert_notequal(attrs[6], attrs[7])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
350 call assert_notequal(attrs0[0], attrs[0])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
351 call assert_notequal(attrs0[7], attrs[7])
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
352 call Check_lcs_eol_attrs(attrs, 1, 10)
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
353 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
354
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
355 call CloseWindow()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
356 exe hiCursorLine
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
357 endfunc
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
358
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
359 func Test_highlight_eol_with_cursorline_sign()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
360 if !has('signs')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
361 return
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
362 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
363
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
364 let [hiCursorLine, hi_ul, hi_bg] = HiCursorLine()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
365
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
366 call NewWindow('topleft 5', 10)
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
367 call setline(1, 'abcd')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
368 call matchadd('Search', '\n')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
369
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
370 sign define Sign text=>>
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
371 exe 'sign place 1 line=1 name=Sign buffer=' . bufnr('')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
372 let attrs0 = ScreenAttrs(1, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
373 setlocal cursorline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
374
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
375 " underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
376 exe hi_ul
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
377
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
378 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
379 " '>>abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
380 " ^^ sign
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
381 " ^^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
382 " ^ 'Search' highlight with underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
383 " ^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
384 let attrs = ScreenAttrs(1, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
385 call assert_equal(repeat([attrs[2]], 4), attrs[2:5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
386 call assert_equal([attrs[6]] + repeat([attrs[7]], 3), attrs[6:9])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
387 call assert_notequal(attrs[2], attrs[6])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
388 call assert_notequal(attrs[6], attrs[7])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
389 call assert_notequal(attrs0[2], attrs[2])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
390 call assert_notequal(attrs0[6], attrs[6])
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
391 call Check_lcs_eol_attrs(attrs, 1, 10)
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
392
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
393 if IsColorable()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
394 " bg-color
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
395 exe hi_bg
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
396
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
397 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
398 " '>>abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
399 " ^^ sign
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
400 " ^^^^ bg-color of 'CursorLine'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
401 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
402 " ^^^ bg-color of 'CursorLine'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
403 let attrs = ScreenAttrs(1, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
404 call assert_equal(repeat([attrs[2]], 4), attrs[2:5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
405 call assert_equal(repeat([attrs[7]], 3), attrs[7:9])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
406 call assert_equal(attrs0[6], attrs[6])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
407 call assert_notequal(attrs[2], attrs[6])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
408 call assert_notequal(attrs[6], attrs[7])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
409 call assert_notequal(attrs0[2], attrs[2])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
410 call assert_notequal(attrs0[7], attrs[7])
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
411 call Check_lcs_eol_attrs(attrs, 1, 10)
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
412 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
413
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
414 sign unplace 1
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
415 call CloseWindow()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
416 exe hiCursorLine
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
417 endfunc
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
418
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
419 func Test_highlight_eol_with_cursorline_breakindent()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
420 if !has('linebreak')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
421 return
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
422 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
423
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
424 let [hiCursorLine, hi_ul, hi_bg] = HiCursorLine()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
425
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
426 call NewWindow('topleft 5', 10)
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
427 setlocal breakindent breakindentopt=min:0,shift:1 showbreak=>
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
428 call setline(1, ' ' . repeat('a', 9) . 'bcd')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
429 call matchadd('Search', '\n')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
430 let attrs0 = ScreenAttrs(2, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
431 setlocal cursorline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
432
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
433 " underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
434 exe hi_ul
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
435
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
436 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
437 " ' >bcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
438 " ^^^ breakindent and showbreak
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
439 " ^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
440 " ^ 'Search' highlight with underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
441 " ^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
442 let attrs = ScreenAttrs(2, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
443 call assert_equal(repeat([attrs[0]], 2), attrs[0:1])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
444 call assert_equal(repeat([attrs[3]], 3), attrs[3:5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
445 call assert_equal([attrs[6]] + repeat([attrs[7]], 3), attrs[6:9])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
446 call assert_equal(attrs0[0], attrs[0])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
447 call assert_notequal(attrs[0], attrs[2])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
448 call assert_notequal(attrs[2], attrs[3])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
449 call assert_notequal(attrs[3], attrs[6])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
450 call assert_notequal(attrs[6], attrs[7])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
451 call assert_notequal(attrs0[2], attrs[2])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
452 call assert_notequal(attrs0[3], attrs[3])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
453 call assert_notequal(attrs0[6], attrs[6])
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
454 call Check_lcs_eol_attrs(attrs, 2, 10)
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
455
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
456 if IsColorable()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
457 " bg-color
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
458 exe hi_bg
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
459
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
460 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
461 " ' >bcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
462 " ^^^ breakindent and showbreak
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
463 " ^^^ bg-color of 'CursorLine'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
464 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
465 " ^^^ bg-color of 'CursorLine'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
466 let attrs = ScreenAttrs(2, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
467 call assert_equal(repeat([attrs[0]], 2), attrs[0:1])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
468 call assert_equal(repeat([attrs[3]], 3), attrs[3:5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
469 call assert_equal(repeat([attrs[7]], 3), attrs[7:9])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
470 call assert_equal(attrs0[0], attrs[0])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
471 call assert_equal(attrs0[6], attrs[6])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
472 call assert_notequal(attrs[0], attrs[2])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
473 call assert_notequal(attrs[2], attrs[3])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
474 call assert_notequal(attrs[3], attrs[6])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
475 call assert_notequal(attrs[6], attrs[7])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
476 call assert_notequal(attrs0[2], attrs[2])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
477 call assert_notequal(attrs0[3], attrs[3])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
478 call assert_notequal(attrs0[7], attrs[7])
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
479 call Check_lcs_eol_attrs(attrs, 2, 10)
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
480 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
481
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
482 call CloseWindow()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
483 set showbreak=
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
484 exe hiCursorLine
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
485 endfunc
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
486
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
487 func Test_highlight_eol_on_diff()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
488 call setline(1, ['abcd', ''])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
489 call matchadd('Search', '\n')
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
490 let attrs0 = ScreenAttrs(1, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
491
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
492 diffthis
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
493 botright new
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
494 diffthis
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
495
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
496 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
497 " ' abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
498 " ^^ sign
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
499 " ^^^^ ^^^ 'DiffAdd' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
500 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
501 let attrs = ScreenAttrs(1, 10)[0]
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
502 call assert_equal(repeat([attrs[0]], 2), attrs[0:1])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
503 call assert_equal(repeat([attrs[2]], 4), attrs[2:5])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
504 call assert_equal(repeat([attrs[2]], 3), attrs[7:9])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
505 call assert_equal(attrs0[4], attrs[6])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
506 call assert_notequal(attrs[0], attrs[2])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
507 call assert_notequal(attrs[0], attrs[6])
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
508 call assert_notequal(attrs[2], attrs[6])
12582
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
509 call Check_lcs_eol_attrs(attrs, 1, 10)
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
510
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
511 bwipe!
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
512 diffoff
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
513 endfunc
13452
9b09f6e470e0 patch 8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set
Christian Brabandt <cb@256bit.org>
parents: 12582
diff changeset
514
9b09f6e470e0 patch 8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set
Christian Brabandt <cb@256bit.org>
parents: 12582
diff changeset
515 func Test_termguicolors()
9b09f6e470e0 patch 8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set
Christian Brabandt <cb@256bit.org>
parents: 12582
diff changeset
516 if !exists('+termguicolors')
9b09f6e470e0 patch 8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set
Christian Brabandt <cb@256bit.org>
parents: 12582
diff changeset
517 return
9b09f6e470e0 patch 8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set
Christian Brabandt <cb@256bit.org>
parents: 12582
diff changeset
518 endif
13454
1720b96e53b6 patch 8.0.1601: highlight test fails on Win32
Christian Brabandt <cb@256bit.org>
parents: 13452
diff changeset
519 if has('vtp') && !has('vcon')
1720b96e53b6 patch 8.0.1601: highlight test fails on Win32
Christian Brabandt <cb@256bit.org>
parents: 13452
diff changeset
520 " Win32: 'guicolors' doesn't work without virtual console.
1720b96e53b6 patch 8.0.1601: highlight test fails on Win32
Christian Brabandt <cb@256bit.org>
parents: 13452
diff changeset
521 call assert_fails('set termguicolors', 'E954:')
1720b96e53b6 patch 8.0.1601: highlight test fails on Win32
Christian Brabandt <cb@256bit.org>
parents: 13452
diff changeset
522 return
1720b96e53b6 patch 8.0.1601: highlight test fails on Win32
Christian Brabandt <cb@256bit.org>
parents: 13452
diff changeset
523 endif
13452
9b09f6e470e0 patch 8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set
Christian Brabandt <cb@256bit.org>
parents: 12582
diff changeset
524
9b09f6e470e0 patch 8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set
Christian Brabandt <cb@256bit.org>
parents: 12582
diff changeset
525 " Basic test that setting 'termguicolors' works with one color.
9b09f6e470e0 patch 8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set
Christian Brabandt <cb@256bit.org>
parents: 12582
diff changeset
526 set termguicolors
9b09f6e470e0 patch 8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set
Christian Brabandt <cb@256bit.org>
parents: 12582
diff changeset
527 redraw
9b09f6e470e0 patch 8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set
Christian Brabandt <cb@256bit.org>
parents: 12582
diff changeset
528 set t_Co=1
9b09f6e470e0 patch 8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set
Christian Brabandt <cb@256bit.org>
parents: 12582
diff changeset
529 redraw
9b09f6e470e0 patch 8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set
Christian Brabandt <cb@256bit.org>
parents: 12582
diff changeset
530 set t_Co=0
9b09f6e470e0 patch 8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set
Christian Brabandt <cb@256bit.org>
parents: 12582
diff changeset
531 redraw
9b09f6e470e0 patch 8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set
Christian Brabandt <cb@256bit.org>
parents: 12582
diff changeset
532 endfunc
15683
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
533
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
534 func Test_cursorline_after_yank()
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
535 if !CanRunVimInTerminal()
16965
ba7727889385 patch 8.1.1483: skipped tests are not properly listed
Bram Moolenaar <Bram@vim.org>
parents: 16788
diff changeset
536 throw 'Skipped: cannot make screendumps'
15683
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
537 endif
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
538
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
539 call writefile([
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
540 \ 'set cul rnu',
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
541 \ 'call setline(1, ["","1","2","3",""])',
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
542 \ ], 'Xtest_cursorline_yank')
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
543 let buf = RunVimInTerminal('-S Xtest_cursorline_yank', {'rows': 8})
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
544 call term_wait(buf)
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
545 call term_sendkeys(buf, "Gy3k")
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
546 call term_wait(buf)
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
547 call term_sendkeys(buf, "jj")
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
548
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
549 call VerifyScreenDump(buf, 'Test_cursorline_yank_01', {})
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
550
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
551 " clean up
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
552 call StopVimInTerminal(buf)
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
553 call delete('Xtest_cursorline_yank')
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
554 endfunc
15991
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
555
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
556 func Test_cursorline_with_visualmode()
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
557 if !CanRunVimInTerminal()
16965
ba7727889385 patch 8.1.1483: skipped tests are not properly listed
Bram Moolenaar <Bram@vim.org>
parents: 16788
diff changeset
558 throw 'Skipped: cannot make screendumps'
15991
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
559 endif
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
560
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
561 call writefile([
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
562 \ 'set cul',
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
563 \ 'call setline(1, repeat(["abc"], 50))',
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
564 \ ], 'Xtest_cursorline_with_visualmode')
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
565 let buf = RunVimInTerminal('-S Xtest_cursorline_with_visualmode', {'rows': 12})
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
566 call term_wait(buf)
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
567 call term_sendkeys(buf, "V\<C-f>kkkjk")
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
568
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
569 call VerifyScreenDump(buf, 'Test_cursorline_with_visualmode_01', {})
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
570
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
571 " clean up
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
572 call StopVimInTerminal(buf)
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
573 call delete('Xtest_cursorline_with_visualmode')
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
574 endfunc
16611
96e93765d0d6 patch 8.1.1308: the Normal highlight is not defined when compiled with GUI
Bram Moolenaar <Bram@vim.org>
parents: 15991
diff changeset
575
16788
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
576 func Test_wincolor()
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
577 if !CanRunVimInTerminal()
16965
ba7727889385 patch 8.1.1483: skipped tests are not properly listed
Bram Moolenaar <Bram@vim.org>
parents: 16788
diff changeset
578 throw 'Skipped: cannot make screendumps'
16788
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
579 endif
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
580
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
581 let lines =<< trim END
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
582 set cursorline cursorcolumn rnu
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
583 call setline(1, ["","1111111111","22222222222","3 here 3",""])
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
584 set wincolor=Pmenu
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
585 /here
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
586 END
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
587 call writefile(lines, 'Xtest_wincolor')
16788
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
588 let buf = RunVimInTerminal('-S Xtest_wincolor', {'rows': 8})
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
589 call term_wait(buf)
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
590 call term_sendkeys(buf, "2G5lvj")
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
591 call term_wait(buf)
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
592
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
593 call VerifyScreenDump(buf, 'Test_wincolor_01', {})
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
594
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
595 " clean up
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
596 call term_sendkeys(buf, "\<Esc>")
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
597 call StopVimInTerminal(buf)
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
598 call delete('Xtest_wincolor')
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
599 endfunc
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
600
16613
850e13b71c1c patch 8.1.1309: test for Normal highlight fails on MS-Windows GUI
Bram Moolenaar <Bram@vim.org>
parents: 16611
diff changeset
601 " This test must come before the Test_cursorline test, as it appears this
850e13b71c1c patch 8.1.1309: test for Normal highlight fails on MS-Windows GUI
Bram Moolenaar <Bram@vim.org>
parents: 16611
diff changeset
602 " defines the Normal highlighting group anyway.
16611
96e93765d0d6 patch 8.1.1308: the Normal highlight is not defined when compiled with GUI
Bram Moolenaar <Bram@vim.org>
parents: 15991
diff changeset
603 func Test_1_highlight_Normalgroup_exists()
17239
fceb0977275a patch 8.1.1619: tests are not run with GUI on Travis
Bram Moolenaar <Bram@vim.org>
parents: 17214
diff changeset
604 let hlNormal = HighlightArgs('Normal')
fceb0977275a patch 8.1.1619: tests are not run with GUI on Travis
Bram Moolenaar <Bram@vim.org>
parents: 17214
diff changeset
605 if !has('gui_running')
16613
850e13b71c1c patch 8.1.1309: test for Normal highlight fails on MS-Windows GUI
Bram Moolenaar <Bram@vim.org>
parents: 16611
diff changeset
606 call assert_match('hi Normal\s*clear', hlNormal)
17239
fceb0977275a patch 8.1.1619: tests are not run with GUI on Travis
Bram Moolenaar <Bram@vim.org>
parents: 17214
diff changeset
607 elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3')
fceb0977275a patch 8.1.1619: tests are not run with GUI on Travis
Bram Moolenaar <Bram@vim.org>
parents: 17214
diff changeset
608 " expect is DEFAULT_FONT of gui_gtk_x11.c
fceb0977275a patch 8.1.1619: tests are not run with GUI on Travis
Bram Moolenaar <Bram@vim.org>
parents: 17214
diff changeset
609 call assert_match('hi Normal\s*font=Monospace 10', hlNormal)
fceb0977275a patch 8.1.1619: tests are not run with GUI on Travis
Bram Moolenaar <Bram@vim.org>
parents: 17214
diff changeset
610 elseif has('gui_motif') || has('gui_athena')
fceb0977275a patch 8.1.1619: tests are not run with GUI on Travis
Bram Moolenaar <Bram@vim.org>
parents: 17214
diff changeset
611 " expect is DEFAULT_FONT of gui_x11.c
fceb0977275a patch 8.1.1619: tests are not run with GUI on Travis
Bram Moolenaar <Bram@vim.org>
parents: 17214
diff changeset
612 call assert_match('hi Normal\s*font=7x13', hlNormal)
fceb0977275a patch 8.1.1619: tests are not run with GUI on Travis
Bram Moolenaar <Bram@vim.org>
parents: 17214
diff changeset
613 elseif has('win32')
fceb0977275a patch 8.1.1619: tests are not run with GUI on Travis
Bram Moolenaar <Bram@vim.org>
parents: 17214
diff changeset
614 " expect any font
fceb0977275a patch 8.1.1619: tests are not run with GUI on Travis
Bram Moolenaar <Bram@vim.org>
parents: 17214
diff changeset
615 call assert_match('hi Normal\s*font=.*', hlNormal)
16613
850e13b71c1c patch 8.1.1309: test for Normal highlight fails on MS-Windows GUI
Bram Moolenaar <Bram@vim.org>
parents: 16611
diff changeset
616 endif
16611
96e93765d0d6 patch 8.1.1308: the Normal highlight is not defined when compiled with GUI
Bram Moolenaar <Bram@vim.org>
parents: 15991
diff changeset
617 endfunc
17214
079ce74ecaa5 patch 8.1.1606: on a narrow screen ":hi" output is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
618
079ce74ecaa5 patch 8.1.1606: on a narrow screen ":hi" output is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
619 function Test_no_space_before_xxx()
079ce74ecaa5 patch 8.1.1606: on a narrow screen ":hi" output is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
620 let l:org_columns = &columns
079ce74ecaa5 patch 8.1.1606: on a narrow screen ":hi" output is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
621 set columns=17
079ce74ecaa5 patch 8.1.1606: on a narrow screen ":hi" output is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
622 let l:hi_StatusLineTermNC = join(split(execute('hi StatusLineTermNC')))
079ce74ecaa5 patch 8.1.1606: on a narrow screen ":hi" output is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
623 call assert_match('StatusLineTermNC xxx', l:hi_StatusLineTermNC)
079ce74ecaa5 patch 8.1.1606: on a narrow screen ":hi" output is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
624 let &columns = l:org_columns
079ce74ecaa5 patch 8.1.1606: on a narrow screen ":hi" output is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
625 endfunction