annotate vendor/vim-packs/srcery-vim/autoload/srcery/helper.vim @ 739:2cf87b7ca09a default tip

Update vendored stuff
author nanaya <me@nanaya.net>
date Thu, 09 Jan 2025 03:28:23 +0900
parents 1e0f578f6752
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
704
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
1 " -----------------------------------------------------------------------------
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
2 " File: helper.vim
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
3 " Description: Srcery colorscheme helpers functions
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
4 " Authors: Daniel Berg <mail@roosta.sh>, Birger J. Nordolum <contact+srcery@mindtooth.no>
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
5 " Last Modified: 2020-08-27
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
6 " -----------------------------------------------------------------------------
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
7
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
8 " Helper to get a source color defined in colorscheme
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
9 function! srcery#helper#GetColor(group, ...) abort
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
10 " Arguments: group, what
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
11
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
12 " optionally pass a 'what' argument, defaults to 'fg'
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
13 if a:0 > 0
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
14 let l:what = a:1
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
15 else
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
16 let l:what = 'fg'
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
17 endif
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
18
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
19 let l:gui_color = synIDattr(hlID(a:group), l:what, 'gui')
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
20 let l:term_color = synIDattr(hlID(a:group), l:what, 'cterm')
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
21
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
22 return [ l:gui_color, l:term_color ]
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
23 endfunction
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
24
1e0f578f6752 Update vendor and add support for vim packs
nanaya <me@nanaya.net>
parents:
diff changeset
25 " vim: fdm=marker ts=2 sts=2 sw=2 fdl=0: