2018-06-20 20:44:08 +08:00
|
|
|
Execute ( SpaceVim api: vim#highlight ):
|
|
|
|
let hi = SpaceVim#api#import('vim#highlight')
|
2020-08-29 16:46:57 +08:00
|
|
|
let cmp =SpaceVim#api#import('vim#compatible')
|
2018-06-20 20:44:08 +08:00
|
|
|
highlight TestAPIVimHighlight ctermfg=11 guifg=#89DDFF guibg=#212121
|
2020-05-15 21:44:02 +08:00
|
|
|
let test_api_hi = hi.group2dict('TestAPIVimHighlight')
|
2020-08-29 16:46:57 +08:00
|
|
|
if !empty(test_api_hi.guifg)
|
|
|
|
Log test_api_hi
|
|
|
|
let id = hlID('TestAPIVimHighlight')
|
|
|
|
Log 'guifg is: ' . synIDattr(id, 'fg#', 'gui')
|
|
|
|
Log 'guibg is: ' . synIDattr(id, 'bg#', 'gui')
|
|
|
|
Log cmp.execute('hi TestAPIVimHighlight')
|
|
|
|
AssertEqual test_api_hi.guibg, '#212121'
|
|
|
|
AssertEqual test_api_hi.guifg, '#89ddff'
|
|
|
|
endif
|
2020-05-15 21:44:02 +08:00
|
|
|
AssertEqual test_api_hi.ctermfg, '11'
|
|
|
|
|
|
|
|
let unknown_hi = hi.group2dict('UnknownHighlightGroup')
|
|
|
|
AssertEqual unknown_hi.name, ''
|
|
|
|
AssertEqual unknown_hi.ctermbg, ''
|
|
|
|
AssertEqual unknown_hi.ctermfg, ''
|
|
|
|
AssertEqual unknown_hi.bold, ''
|
|
|
|
AssertEqual unknown_hi.italic, ''
|
|
|
|
AssertEqual unknown_hi.reverse, ''
|
|
|
|
AssertEqual unknown_hi.underline, ''
|
|
|
|
AssertEqual unknown_hi.guibg, ''
|
|
|
|
AssertEqual unknown_hi.guifg, ''
|
2020-08-29 16:46:57 +08:00
|
|
|
unlet hi cmp test_api_hi unknown_hi
|