File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ def index_to_rgb(index):
7272 elif 233 <= index < 254 :
7373 return [8 + (index - 232 )* 0x0A ]* 3
7474
75- colortable = [ index_to_rgb ( color ) for color in range (0 , 254 )]
75+ colortable = list ( map ( index_to_rgb , range (0 , 254 )))
7676
7777 @staticmethod
7878 def diff (rgb1 , rgb2 ):
Original file line number Diff line number Diff line change @@ -11,21 +11,25 @@ set cpo&vim
1111function ! csscolor#initialize ()
1212 let pycode = globpath (&rtp , ' autoload/csscolor.py' )
1313 if has (' python' )
14- execute ' pyfile' pycode
14+ let s: pyfile = ' pyfile'
15+ let s: python = ' python'
1516 elseif has (' python3' )
16- execute ' py3file' pycode
17+ let s: pyfile = ' py3file'
18+ let s: python = ' python3'
1719 else
1820 echoerr ' Python interface is not available.'
21+ finish
1922 endif
23+ execute s: pyfile pycode
2024endfunction
2125call csscolor#initialize ()
2226
2327function ! csscolor#percentage_to_code (r , g , b )
24- execute " python VimCSSColor.percentage_to_code('" .a: r ." ','" .a: g ." ','" .a: b ." ')"
28+ execute s: python " VimCSSColor.percentage_to_code('" .a: r ." ','" .a: g ." ','" .a: b ." ')"
2529endfunction
2630
2731function ! csscolor#add_highlight (group, color )
28- execute " python VimCSSColor.add_highlight('" .a: group ." ', '" .a: color ." ')"
32+ execute s: python " VimCSSColor.add_highlight('" .a: group ." ', '" .a: color ." ')"
2933endfunction
3034
3135function ! csscolor#is_syntax_exist (pattern, group)
You can’t perform that action at this time.
0 commit comments