mirror of
https://github.com/osyo-manga/vim-brightest.git
synced 2025-11-12 05:23:52 -05:00
Improve brightest#parse_cursorline_highlight_group.
This commit is contained in:
@@ -31,6 +31,7 @@ endfunction
|
||||
|
||||
function! s:is_ignore_syntax_in_cursor(context)
|
||||
let list = get(b:, "brightest_ignore_syntax_list", g:brightest#ignore_syntax_list)
|
||||
|
||||
if empty(list)
|
||||
return 0
|
||||
endif
|
||||
@@ -174,10 +175,15 @@ function! brightest#highlighting()
|
||||
endfunction
|
||||
|
||||
|
||||
let s:parse_cursorline_highlight_group_memo = {}
|
||||
function! brightest#parse_cursorline_highlight_group(group)
|
||||
redir => hl
|
||||
silent execute "highlight" a:group
|
||||
redir END
|
||||
let key = hl
|
||||
if has_key(s:parse_cursorline_highlight_group_memo, key)
|
||||
return s:parse_cursorline_highlight_group_memo[key]
|
||||
endif
|
||||
let hl = substitute(hl, '\n', '', 'g')
|
||||
let hl = matchstr(hl, '.*xxx\zs.*')
|
||||
let guibg = synIDattr(synIDtrans(hlID("CursorLine")), "bg", "gui")
|
||||
@@ -197,6 +203,7 @@ function! brightest#parse_cursorline_highlight_group(group)
|
||||
let hl .= ' ctermbg=' . ctermbg
|
||||
endif
|
||||
endif
|
||||
let s:parse_cursorline_highlight_group_memo[key] = hl
|
||||
return hl
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user