Mercurial > vim
comparison src/testdir/test_highlight.vim @ 15406:63b02fcf1361 v8.1.0711
patch 8.1.0711: test files still use function!
commit https://github.com/vim/vim/commit/1e1153600c0377472d62cc553173fe555ddcf5a7
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jan 9 23:01:02 2019 +0100
patch 8.1.0711: test files still use function!
Problem: Test files still use function!.
Solution: Remove the exclamation mark. Fix overwriting a function.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 09 Jan 2019 23:15:05 +0100 |
parents | 1720b96e53b6 |
children | adc6442118b8 |
comparison
equal
deleted
inserted
replaced
15405:3a8785d45112 | 15406:63b02fcf1361 |
---|---|
36 call assert_equal("Group3 xxx cleared", | 36 call assert_equal("Group3 xxx cleared", |
37 \ split(execute("hi Group3"), "\n")[0]) | 37 \ split(execute("hi Group3"), "\n")[0]) |
38 call assert_fails("hi Crash term='asdf", "E475:") | 38 call assert_fails("hi Crash term='asdf", "E475:") |
39 endfunc | 39 endfunc |
40 | 40 |
41 function! HighlightArgs(name) | 41 func HighlightArgs(name) |
42 return 'hi ' . substitute(split(execute('hi ' . a:name), '\n')[0], '\<xxx\>', '', '') | 42 return 'hi ' . substitute(split(execute('hi ' . a:name), '\n')[0], '\<xxx\>', '', '') |
43 endfunction | 43 endfunc |
44 | 44 |
45 function! IsColorable() | 45 func IsColorable() |
46 return has('gui_running') || str2nr(&t_Co) >= 8 | 46 return has('gui_running') || str2nr(&t_Co) >= 8 |
47 endfunction | 47 endfunc |
48 | 48 |
49 function! HiCursorLine() | 49 func HiCursorLine() |
50 let hiCursorLine = HighlightArgs('CursorLine') | 50 let hiCursorLine = HighlightArgs('CursorLine') |
51 if has('gui_running') | 51 if has('gui_running') |
52 let guibg = matchstr(hiCursorLine, 'guibg=\w\+') | 52 let guibg = matchstr(hiCursorLine, 'guibg=\w\+') |
53 let hi_ul = 'hi CursorLine gui=underline guibg=NONE' | 53 let hi_ul = 'hi CursorLine gui=underline guibg=NONE' |
54 let hi_bg = 'hi CursorLine gui=NONE ' . guibg | 54 let hi_bg = 'hi CursorLine gui=NONE ' . guibg |
55 else | 55 else |
56 let hi_ul = 'hi CursorLine cterm=underline ctermbg=NONE' | 56 let hi_ul = 'hi CursorLine cterm=underline ctermbg=NONE' |
57 let hi_bg = 'hi CursorLine cterm=NONE ctermbg=Gray' | 57 let hi_bg = 'hi CursorLine cterm=NONE ctermbg=Gray' |
58 endif | 58 endif |
59 return [hiCursorLine, hi_ul, hi_bg] | 59 return [hiCursorLine, hi_ul, hi_bg] |
60 endfunction | 60 endfunc |
61 | 61 |
62 function! Check_lcs_eol_attrs(attrs, row, col) | 62 func Check_lcs_eol_attrs(attrs, row, col) |
63 let save_lcs = &lcs | 63 let save_lcs = &lcs |
64 set list | 64 set list |
65 | 65 |
66 call assert_equal(a:attrs, ScreenAttrs(a:row, a:col)[0]) | 66 call assert_equal(a:attrs, ScreenAttrs(a:row, a:col)[0]) |
67 | 67 |
68 set nolist | 68 set nolist |
69 let &lcs = save_lcs | 69 let &lcs = save_lcs |
70 endfunction | 70 endfunc |
71 | 71 |
72 func Test_highlight_eol_with_cursorline() | 72 func Test_highlight_eol_with_cursorline() |
73 let [hiCursorLine, hi_ul, hi_bg] = HiCursorLine() | 73 let [hiCursorLine, hi_ul, hi_bg] = HiCursorLine() |
74 | 74 |
75 call NewWindow('topleft 5', 20) | 75 call NewWindow('topleft 5', 20) |