annotate src/testdir/test_highlight.vim @ 22288:a9ff3e0d6d54 v8.2.1693

patch 8.2.1693: "hi def" does not work for cleared highlight Commit: https://github.com/vim/vim/commit/05eb5b9cae123b138bbd23cc77e50657ece6b4ad Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 16 15:43:21 2020 +0200 patch 8.2.1693: "hi def" does not work for cleared highlight Problem: "hi def" does not work for cleared highlight. Solution: Check the "sg_cleared" flag. (Maxim Kim, closes https://github.com/vim/vim/issues/6956, closes #4405)
author Bram Moolenaar <Bram@vim.org>
date Wed, 16 Sep 2020 15:45:05 +0200
parents 47ebfc274e3f
children 19e0784ef769
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
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17239
diff changeset
5 source check.vim
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
6
12019
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 func Test_highlight()
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 " 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
9 highlight
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 hi Search
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 " test setting colors.
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 " 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
14 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
15 silent! hi Group2 term= cterm=
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 hi Group3 term=underline cterm=bold
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 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
19 " 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
20 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
21 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
22 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
23 \ res)
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 call assert_equal("Group2 xxx cleared",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 \ split(execute("hi Group2"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 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
27 \ split(execute("hi Group3"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 hi clear NewGroup
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 call assert_equal("NewGroup xxx cleared",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 \ split(execute("hi NewGroup"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 call assert_equal("Group2 xxx cleared",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 \ split(execute("hi Group2"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 hi Group2 NONE
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 call assert_equal("Group2 xxx cleared",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 \ split(execute("hi Group2"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 hi clear
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 call assert_equal("Group3 xxx cleared",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 \ split(execute("hi Group3"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 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
41 endfunc
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
42
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 13454
diff changeset
43 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
44 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
45 endfunc
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
46
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 13454
diff changeset
47 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
48 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
49 endfunc
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
50
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 13454
diff changeset
51 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
52 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
53 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
54 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
55 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
56 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
57 else
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_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
59 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
60 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
61 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
62 endfunc
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
63
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 13454
diff changeset
64 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
65 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
66 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
67
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
68 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
69
97f0c74976c6 patch 8.0.1169: highlignting one char too many with 'list' and 'cul'
Christian Brabandt <cb@256bit.org>
parents: 12580
diff changeset
70 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
71 let &lcs = save_lcs
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 13454
diff changeset
72 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
73
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
74 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
75 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
76
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
77 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
78 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
79 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
80
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
81 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
82 " 'abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
83 " ^^^^ ^^^^^ no highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
84 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
85 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
86 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
87 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
88 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
89
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
90 setlocal cursorline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
91
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
92 " underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
93 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
94
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
95 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
96 " 'abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
97 " ^^^^ 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
98 " ^ '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
99 " ^^^^^ underline
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
100 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
101 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
102 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
103 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
104 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
105 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
106 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
107 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
108
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
109 if IsColorable()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
110 " bg-color
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
111 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
112
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
113 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
114 " 'abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
115 " ^^^^ 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
116 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
117 " ^^^^^ 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
118 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
119 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
120 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
121 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
122 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
123 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
124 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
125 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
126 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
127 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
128
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
129 call CloseWindow()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
130 exe hiCursorLine
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
131 endfunc
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
132
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
133 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
134 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
135
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
136 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
137 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
138 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
139
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
140 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
141 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
142 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
143
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
144 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
145 " 'abcd |abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
146 " ^^^^ ^^^^^^^^^ no highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
147 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
148 " ^ 'VertSplit' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
149 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
150 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
151 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
152 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
153 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
154 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
155
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
156 setlocal cursorline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
157
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
158 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
159 " 'abcd |abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
160 " ^^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
161 " ^ '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
162 " ^ 'VertSplit' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
163 " ^^^^^^^^^ no highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
164
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
165 " underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
166 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
167
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
168 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
169 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
170
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
171 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
172 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
173 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
174 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
175 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
176 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
177 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
178 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
179 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
180 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
181 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
182 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
183
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
184 if IsColorable()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
185 " bg-color
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
186 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
187
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
188 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
189 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
190
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
191 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
192 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
193 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
194 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
195 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
196 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
197 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
198 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
199 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
200 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
201 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
202 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
203 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
204
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
205 call CloseWindow()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
206 exe hiCursorLine
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
207 endfunc
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
208
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
209 func Test_highlight_eol_with_cursorline_rightleft()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21091
diff changeset
210 CheckFeature rightleft
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
211
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
212 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
213
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
214 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
215 setlocal rightleft
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
216 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
217 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
218 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
219
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
220 setlocal cursorline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
221
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
222 " underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
223 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
224
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
225 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
226 " ' dcba'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
227 " ^^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
228 " ^ '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
229 " ^^^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
230 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
231 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
232 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
233 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
234 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
235 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
236 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
237 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
238
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
239 if IsColorable()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
240 " bg-color
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
241 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
242
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
243 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
244 " ' dcba'
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
245 " ^^^^ 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
246 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
247 " ^^^^^ 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
248 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
249 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
250 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
251 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
252 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
253 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
254 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
255 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
256 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
257 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
258
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
259 call CloseWindow()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
260 exe hiCursorLine
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
261 endfunc
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
262
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
263 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
264 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
265
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
266 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
267 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
268 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
269
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
270 setlocal wrap
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
271 normal! gg$
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
272 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
273 setlocal cursorline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
274
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
275 " underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
276 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
277
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
278 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
279 " 'abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
280 " ^^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
281 " ^ '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
282 " ^^^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
283 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
284 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
285 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
286 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
287 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
288 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
289 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
290 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
291
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
292 if IsColorable()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
293 " bg-color
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
294 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
295
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
296 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
297 " 'abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
298 " ^^^^ 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
299 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
300 " ^^^^^ 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
301 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
302 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
303 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
304 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
305 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
306 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
307 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
308 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
309 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
310 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
311
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
312 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
313 normal! gg$
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
314 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
315 setlocal cursorline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
316
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
317 " underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
318 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
319
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
320 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
321 " 'aaabcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
322 " ^^^^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
323 " ^ '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
324 " ^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
325 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
326 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
327 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
328 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
329 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
330 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
331 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
332 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
333
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
334 if IsColorable()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
335 " bg-color
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
336 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
337
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
338 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
339 " 'aaabcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
340 " ^^^^^^ 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
341 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
342 " ^^^ 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
343 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
344 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
345 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
346 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
347 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
348 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
349 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
350 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
351 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
352 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
353
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
354 call CloseWindow()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
355 exe hiCursorLine
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
356 endfunc
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
357
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
358 func Test_highlight_eol_with_cursorline_sign()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21091
diff changeset
359 CheckFeature signs
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
360
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
361 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
362
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
363 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
364 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
365 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
366
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
367 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
368 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
369 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
370 setlocal cursorline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
371
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
372 " underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
373 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
374
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
375 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
376 " '>>abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
377 " ^^ sign
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
378 " ^^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
379 " ^ '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
380 " ^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
381 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
382 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
383 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
384 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
385 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
386 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
387 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
388 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
389
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
390 if IsColorable()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
391 " bg-color
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
392 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
393
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
394 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
395 " '>>abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
396 " ^^ sign
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
397 " ^^^^ 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
398 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
399 " ^^^ 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
400 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
401 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
402 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
403 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
404 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
405 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
406 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
407 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
408 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
409 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
410
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
411 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
412 call CloseWindow()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
413 exe hiCursorLine
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
414 endfunc
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
415
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
416 func Test_highlight_eol_with_cursorline_breakindent()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21091
diff changeset
417 CheckFeature linebreak
12580
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 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
420
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
421 call NewWindow('topleft 5', 10)
18574
8b0114ffde2b patch 8.1.2281: 'showbreak' cannot be set for one window
Bram Moolenaar <Bram@vim.org>
parents: 18156
diff changeset
422 set showbreak=xxx
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
423 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
424 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
425 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
426 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
427 setlocal cursorline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
428
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
429 " underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
430 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
431
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
432 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
433 " ' >bcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
434 " ^^^ 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
435 " ^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
436 " ^ '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
437 " ^^^ underline
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
438 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
439 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
440 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
441 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
442 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
443 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
444 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
445 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
446 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
447 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
448 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
449 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
450 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
451
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
452 if IsColorable()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
453 " bg-color
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
454 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
455
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
456 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
457 " ' >bcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
458 " ^^^ 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
459 " ^^^ 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
460 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
461 " ^^^ 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
462 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
463 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
464 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
465 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
466 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
467 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
468 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
469 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
470 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
471 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
472 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
473 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
474 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
475 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
476 endif
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
477
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
478 call CloseWindow()
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
479 set showbreak=
18574
8b0114ffde2b patch 8.1.2281: 'showbreak' cannot be set for one window
Bram Moolenaar <Bram@vim.org>
parents: 18156
diff changeset
480 setlocal showbreak=
12580
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
481 exe hiCursorLine
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
482 endfunc
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
483
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
484 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
485 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
486 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
487 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
488
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
489 diffthis
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
490 botright new
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
491 diffthis
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
492
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
493 " expected:
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
494 " ' abcd '
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
495 " ^^ sign
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
496 " ^^^^ ^^^ 'DiffAdd' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
497 " ^ 'Search' highlight
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
498 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
499 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
500 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
501 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
502 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
503 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
504 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
505 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
506 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
507
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
508 bwipe!
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
509 diffoff
ba55861aa52c patch 8.0.1168: wrong highlighting with combination of match and 'cursorline'
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
510 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
511
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
512 func Test_termguicolors()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21091
diff changeset
513 CheckOption termguicolors
18742
e9b2ade1adbd patch 8.1.2361: MS-Windows: test failures related to VIMDLL
Bram Moolenaar <Bram@vim.org>
parents: 18574
diff changeset
514 if has('vtp') && !has('vcon') && !has('gui_running')
13454
1720b96e53b6 patch 8.0.1601: highlight test fails on Win32
Christian Brabandt <cb@256bit.org>
parents: 13452
diff changeset
515 " 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
516 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
517 return
1720b96e53b6 patch 8.0.1601: highlight test fails on Win32
Christian Brabandt <cb@256bit.org>
parents: 13452
diff changeset
518 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
519
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
520 " 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
521 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
522 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
523 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
524 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
525 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
526 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
527 endfunc
15683
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
528
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
529 func Test_cursorline_after_yank()
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17239
diff changeset
530 CheckScreendump
15683
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
531
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
532 call writefile([
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
533 \ 'set cul rnu',
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
534 \ '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
535 \ ], 'Xtest_cursorline_yank')
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
536 let buf = RunVimInTerminal('-S Xtest_cursorline_yank', {'rows': 8})
19954
c087099e9163 patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents: 19932
diff changeset
537 call TermWait(buf)
15683
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
538 call term_sendkeys(buf, "Gy3k")
19954
c087099e9163 patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents: 19932
diff changeset
539 call TermWait(buf)
15683
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
540 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
541
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
542 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
543
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
544 " clean up
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
545 call StopVimInTerminal(buf)
adc6442118b8 patch 8.1.0849: cursorline highlight is not always updated
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
546 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
547 endfunc
15991
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
548
18023
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
549 " test for issue #4862
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
550 func Test_put_before_cursorline()
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
551 new
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
552 only!
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
553 call setline(1, 'A')
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
554 redraw
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
555 let std_attr = screenattr(1, 1)
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
556 set cursorline
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
557 redraw
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
558 let cul_attr = screenattr(1, 1)
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
559 normal yyP
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
560 redraw
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
561 " Line 1 has cursor so it should be highlighted with CursorLine.
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
562 call assert_equal(cul_attr, screenattr(1, 1))
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
563 " And CursorLine highlighting from the second line should be gone.
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
564 call assert_equal(std_attr, screenattr(2, 1))
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
565 set nocursorline
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
566 bwipe!
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
567 endfunc
fd75825d06db patch 8.1.2007: no test for what 8.1.1926 fixes
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
568
15991
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
569 func Test_cursorline_with_visualmode()
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17239
diff changeset
570 CheckScreendump
15991
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
571
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
572 call writefile([
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
573 \ 'set cul',
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
574 \ '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
575 \ ], '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
576 let buf = RunVimInTerminal('-S Xtest_cursorline_with_visualmode', {'rows': 12})
19954
c087099e9163 patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents: 19932
diff changeset
577 call TermWait(buf)
15991
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
578 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
579
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
580 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
581
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
582 " clean up
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
583 call StopVimInTerminal(buf)
f362d695bcf9 patch 8.1.1001: Visual area not correct when using 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15683
diff changeset
584 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
585 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
586
16788
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
587 func Test_wincolor()
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17239
diff changeset
588 CheckScreendump
19273
a4b65930a0dc patch 8.2.0195: some tests fail when run in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 19255
diff changeset
589 " make sure the width is enough for the test
a4b65930a0dc patch 8.2.0195: some tests fail when run in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 19255
diff changeset
590 set columns=80
16788
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
591
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
592 let lines =<< trim END
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
593 set cursorline cursorcolumn rnu
18152
1acc94f17906 patch 8.1.2071: when 'wincolor' is set text property changes highlighting
Bram Moolenaar <Bram@vim.org>
parents: 18023
diff changeset
594 call setline(1, ["","1111111111","22222222222","3 here 3","","the cat is out of the bag"])
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
595 set wincolor=Pmenu
18152
1acc94f17906 patch 8.1.2071: when 'wincolor' is set text property changes highlighting
Bram Moolenaar <Bram@vim.org>
parents: 18023
diff changeset
596 hi CatLine guifg=green ctermfg=green
1acc94f17906 patch 8.1.2071: when 'wincolor' is set text property changes highlighting
Bram Moolenaar <Bram@vim.org>
parents: 18023
diff changeset
597 hi Reverse gui=reverse cterm=reverse
1acc94f17906 patch 8.1.2071: when 'wincolor' is set text property changes highlighting
Bram Moolenaar <Bram@vim.org>
parents: 18023
diff changeset
598 syn match CatLine /^the.*/
1acc94f17906 patch 8.1.2071: when 'wincolor' is set text property changes highlighting
Bram Moolenaar <Bram@vim.org>
parents: 18023
diff changeset
599 call prop_type_add("foo", {"highlight": "Reverse", "combine": 1})
1acc94f17906 patch 8.1.2071: when 'wincolor' is set text property changes highlighting
Bram Moolenaar <Bram@vim.org>
parents: 18023
diff changeset
600 call prop_add(6, 12, {"type": "foo", "end_col": 15})
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
601 /here
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
602 END
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
603 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
604 let buf = RunVimInTerminal('-S Xtest_wincolor', {'rows': 8})
19954
c087099e9163 patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents: 19932
diff changeset
605 call TermWait(buf)
16788
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
606 call term_sendkeys(buf, "2G5lvj")
19954
c087099e9163 patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents: 19932
diff changeset
607 call TermWait(buf)
16788
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
608
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
609 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
610
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
611 " 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
612 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
613 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
614 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
615 endfunc
f7268ec2c889 patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Bram Moolenaar <Bram@vim.org>
parents: 16613
diff changeset
616
18795
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
617 func Test_wincolor_listchars()
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
618 CheckScreendump
19255
04e1a025ef00 patch 8.2.0186: a couple of tests may fail when features are missing
Bram Moolenaar <Bram@vim.org>
parents: 18795
diff changeset
619 CheckFeature conceal
18795
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
620
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
621 let lines =<< trim END
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
622 call setline(1, ["one","\t\tsome random text enough long to show 'extends' and 'precedes' includingnbsps, preceding tabs and trailing spaces ","three"])
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
623 set wincolor=Todo
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
624 set nowrap cole=1 cocu+=n
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
625 set list lcs=eol:$,tab:>-,space:.,trail:_,extends:>,precedes:<,conceal:*,nbsp:#
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
626 call matchadd('Conceal', 'text')
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
627 normal 2G5zl
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
628 END
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
629 call writefile(lines, 'Xtest_wincolorlcs')
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
630 let buf = RunVimInTerminal('-S Xtest_wincolorlcs', {'rows': 8})
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
631
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
632 call VerifyScreenDump(buf, 'Test_wincolor_lcs', {})
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
633
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
634 " clean up
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
635 call term_sendkeys(buf, "\<Esc>")
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
636 call StopVimInTerminal(buf)
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
637 call delete('Xtest_wincolorlcs')
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
638 endfunc
79b689ff168d patch 8.1.2386: 'wincolor' is not used for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents: 18742
diff changeset
639
18156
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
640 func Test_colorcolumn()
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
641 CheckScreendump
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
642
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
643 " check that setting 'colorcolumn' when entering a buffer works
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
644 let lines =<< trim END
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
645 split
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
646 edit X
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
647 call setline(1, ["1111111111","22222222222","3333333333"])
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
648 set nomodified
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
649 set colorcolumn=3,9
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
650 set number cursorline cursorlineopt=number
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
651 wincmd w
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
652 buf X
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
653 END
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
654 call writefile(lines, 'Xtest_colorcolumn')
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
655 let buf = RunVimInTerminal('-S Xtest_colorcolumn', {'rows': 10})
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
656 call term_sendkeys(buf, ":\<CR>")
19954
c087099e9163 patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents: 19932
diff changeset
657 call TermWait(buf)
18156
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
658 call VerifyScreenDump(buf, 'Test_colorcolumn_1', {})
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
659
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
660 " clean up
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
661 call StopVimInTerminal(buf)
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
662 call delete('Xtest_colorcolumn')
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
663 endfunc
c81370b3ede4 patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents: 18152
diff changeset
664
22280
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
665 func Test_colorcolumn_bri()
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
666 CheckScreendump
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
667
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
668 " check 'colorcolumn' when 'breakindent' is set
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
669 let lines =<< trim END
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
670 call setline(1, 'The quick brown fox jumped over the lazy dogs')
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
671 END
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
672 call writefile(lines, 'Xtest_colorcolumn_bri')
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
673 let buf = RunVimInTerminal('-S Xtest_colorcolumn_bri', {'rows': 10,'columns': 40})
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
674 call term_sendkeys(buf, ":set co=40 linebreak bri briopt=shift:2 cc=40,41,43\<CR>")
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
675 call TermWait(buf)
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
676 call VerifyScreenDump(buf, 'Test_colorcolumn_2', {})
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
677
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
678 " clean up
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
679 call StopVimInTerminal(buf)
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
680 call delete('Xtest_colorcolumn_bri')
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
681 endfunc
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
682
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
683 func Test_colorcolumn_sbr()
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
684 CheckScreendump
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
685
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
686 " check 'colorcolumn' when 'showbreak' is set
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
687 let lines =<< trim END
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
688 call setline(1, 'The quick brown fox jumped over the lazy dogs')
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
689 END
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
690 call writefile(lines, 'Xtest_colorcolumn_srb')
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
691 let buf = RunVimInTerminal('-S Xtest_colorcolumn_srb', {'rows': 10,'columns': 40})
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
692 call term_sendkeys(buf, ":set co=40 showbreak=+++>\\ cc=40,41,43\<CR>")
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
693 call TermWait(buf)
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
694 call VerifyScreenDump(buf, 'Test_colorcolumn_3', {})
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
695
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
696 " clean up
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
697 call StopVimInTerminal(buf)
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
698 call delete('Xtest_colorcolumn_srb')
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
699 endfunc
47ebfc274e3f patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
700
16613
850e13b71c1c patch 8.1.1309: test for Normal highlight fails on MS-Windows GUI
Bram Moolenaar <Bram@vim.org>
parents: 16611
diff changeset
701 " 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
702 " 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
703 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
704 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
705 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
706 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
707 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
708 " 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
709 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
710 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
711 " 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
712 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
713 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
714 " 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
715 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
716 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
717 endfunc
17214
079ce74ecaa5 patch 8.1.1606: on a narrow screen ":hi" output is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
718
19273
a4b65930a0dc patch 8.2.0195: some tests fail when run in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 19255
diff changeset
719 " Do this test last, sometimes restoring the columns doesn't work
19932
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
720 func Test_z_no_space_before_xxx()
17214
079ce74ecaa5 patch 8.1.1606: on a narrow screen ":hi" output is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
721 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
722 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
723 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
724 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
725 let &columns = l:org_columns
19932
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
726 endfunc
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
727
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
728 " Test for :highlight command errors
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
729 func Test_highlight_cmd_errors()
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
730 if has('gui_running')
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
731 " This test doesn't fail in the MS-Windows console version.
21052
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
732 call assert_fails('hi Xcomment ctermbg=fg', 'E419:')
19932
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
733 call assert_fails('hi Xcomment ctermfg=bg', 'E420:')
21052
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
734 call assert_fails('hi Xcomment ctermfg=ul', 'E453:')
19932
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
735 endif
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
736
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
737 " Try using a very long terminal code. Define a dummy terminal code for this
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
738 " test.
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
739 let &t_fo = "\<Esc>1;"
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
740 let c = repeat("t_fo,", 100) . "t_fo"
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
741 call assert_fails('exe "hi Xgroup1 start=" . c', 'E422:')
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
742 let &t_fo = ""
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
743 endfunc
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
744
21052
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
745 " Test for 'highlight' option
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
746 func Test_highlight_opt()
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
747 let save_hl = &highlight
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
748 call assert_fails('set highlight=j:b', 'E474:')
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
749 set highlight=f\ r
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
750 call assert_equal('f r', &highlight)
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
751 set highlight=fb
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
752 call assert_equal('fb', &highlight)
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
753 set highlight=fi
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
754 call assert_equal('fi', &highlight)
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
755 set highlight=f-
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
756 call assert_equal('f-', &highlight)
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
757 set highlight=fr
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
758 call assert_equal('fr', &highlight)
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
759 set highlight=fs
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
760 call assert_equal('fs', &highlight)
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
761 set highlight=fu
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
762 call assert_equal('fu', &highlight)
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
763 set highlight=fc
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
764 call assert_equal('fc', &highlight)
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
765 set highlight=ft
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
766 call assert_equal('ft', &highlight)
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
767 call assert_fails('set highlight=fr:Search', 'E474:')
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
768 set highlight=f:$#
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
769 call assert_match('W18:', v:statusmsg)
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
770 let &highlight = save_hl
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
771 endfunc
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
772
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
773 " Test for User group highlighting used in the statusline
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
774 func Test_highlight_User()
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
775 CheckNotGui
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
776 hi User1 ctermfg=12
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
777 redraw!
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
778 call assert_equal('12', synIDattr(synIDtrans(hlID('User1')), 'fg'))
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
779 hi clear
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
780 endfunc
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
781
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
782 " Test for using RGB color values in a highlight group
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
783 func Test_highlight_RGB_color()
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
784 CheckGui
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
785 hi MySearch guifg=#110000 guibg=#001100 guisp=#000011
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
786 call assert_equal('#110000', synIDattr(synIDtrans(hlID('MySearch')), 'fg#'))
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
787 call assert_equal('#001100', synIDattr(synIDtrans(hlID('MySearch')), 'bg#'))
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
788 call assert_equal('#000011', synIDattr(synIDtrans(hlID('MySearch')), 'sp#'))
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
789 hi clear
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
790 endfunc
f3c72001de63 patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
791
21091
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
792 " Test for using default highlighting group
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
793 func Test_highlight_default()
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
794 highlight MySearch ctermfg=7
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
795 highlight default MySearch ctermfg=5
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
796 let hlSearch = HighlightArgs('MySearch')
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
797 call assert_match('ctermfg=7', hlSearch)
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
798
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
799 highlight default QFName ctermfg=3
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
800 call assert_match('ctermfg=3', HighlightArgs('QFName'))
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
801 hi clear
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
802 endfunc
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
803
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
804 " Test for 'ctermul in a highlight group
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
805 func Test_highlight_ctermul()
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
806 CheckNotGui
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
807 call assert_notmatch('ctermul=', HighlightArgs('Normal'))
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
808 highlight Normal ctermul=3
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
809 call assert_match('ctermul=3', HighlightArgs('Normal'))
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
810 highlight Normal ctermul=NONE
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
811 endfunc
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
812
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
813 " Test for specifying 'start' and 'stop' in a highlight group
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
814 func Test_highlight_start_stop()
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
815 hi HlGrp1 start=<Esc>[27h;<Esc>[<Space>r;
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
816 call assert_match("start=^[[27h;^[[ r;", HighlightArgs('HlGrp1'))
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
817 hi HlGrp1 start=NONE
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
818 call assert_notmatch("start=", HighlightArgs('HlGrp1'))
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
819 hi HlGrp2 stop=<Esc>[27h;<Esc>[<Space>r;
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
820 call assert_match("stop=^[[27h;^[[ r;", HighlightArgs('HlGrp2'))
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
821 hi HlGrp2 stop=NONE
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
822 call assert_notmatch("stop=", HighlightArgs('HlGrp2'))
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
823 hi clear
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
824 endfunc
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
825
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
826 " Test for setting various 'term' attributes
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
827 func Test_highlight_term_attr()
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
828 hi HlGrp3 term=bold,underline,undercurl,strikethrough,reverse,italic,standout
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
829 call assert_equal('hi HlGrp3 term=bold,standout,underline,undercurl,italic,reverse,strikethrough', HighlightArgs('HlGrp3'))
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
830 hi HlGrp3 term=NONE
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
831 call assert_equal('hi HlGrp3 cleared', HighlightArgs('HlGrp3'))
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
832 hi clear
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
833 endfunc
f6eb0c468ae4 patch 8.2.1097: highlight code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21052
diff changeset
834
22288
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
835 " Test default highlighting is restored
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
836 func Test_highlight_restore_defaults()
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
837 hi! link TestLink Identifier
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
838 hi! TestHi ctermbg=red
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
839
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
840 let hlTestLinkPre = HighlightArgs('TestLink')
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
841 let hlTestHiPre = HighlightArgs('TestHi')
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
842
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
843 " Test colorscheme
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
844 hi clear
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
845 if exists('syntax_on')
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
846 syntax reset
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
847 endif
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
848 let g:colors_name = 'test'
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
849 hi! link TestLink ErrorMsg
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
850 hi! TestHi ctermbg=green
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
851
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
852 " Restore default highlighting
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
853 colorscheme default
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
854 syntax on
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
855 " 'default' should work no matter if highlight group was cleared
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
856 hi def link TestLink Identifier
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
857 hi def TestHi ctermbg=red
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
858
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
859 let hlTestLinkPost = HighlightArgs('TestLink')
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
860 let hlTestHiPost = HighlightArgs('TestHi')
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
861
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
862 call assert_equal(hlTestLinkPre, hlTestLinkPost)
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
863 call assert_equal(hlTestHiPre, hlTestHiPost)
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
864 hi clear
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
865 endfunc
a9ff3e0d6d54 patch 8.2.1693: "hi def" does not work for cleared highlight
Bram Moolenaar <Bram@vim.org>
parents: 22280
diff changeset
866
19932
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19273
diff changeset
867 " vim: shiftwidth=2 sts=2 expandtab