comparison runtime/syntax/dircolors.vim @ 9027:773d627cac0b v7.4.1799

commit https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 29 22:59:22 2016 +0200 patch 7.4.1799 Problem: 'guicolors' is a confusing option name. Solution: Use 'termguicolors' instead. (Hirohito Higashi)
author Christian Brabandt <cb@256bit.org>
date Fri, 29 Apr 2016 23:00:07 +0200
parents ab1508486b12
children acd7eaa13d2b
comparison
equal deleted inserted replaced
9026:eea316a77946 9027:773d627cac0b
42 highlight default link dircolorsKeyword Keyword 42 highlight default link dircolorsKeyword Keyword
43 highlight default link dircolorsExtension Identifier 43 highlight default link dircolorsExtension Identifier
44 highlight default link dircolorsEscape Special 44 highlight default link dircolorsEscape Special
45 45
46 function! s:set_guicolors() abort 46 function! s:set_guicolors() abort
47 let s:guicolors = {} 47 let s:termguicolors = {}
48 48
49 let s:guicolors[0] = "Black" 49 let s:termguicolors[0] = "Black"
50 let s:guicolors[1] = "DarkRed" 50 let s:termguicolors[1] = "DarkRed"
51 let s:guicolors[2] = "DarkGreen" 51 let s:termguicolors[2] = "DarkGreen"
52 let s:guicolors[3] = "DarkYellow" 52 let s:termguicolors[3] = "DarkYellow"
53 let s:guicolors[4] = "DarkBlue" 53 let s:termguicolors[4] = "DarkBlue"
54 let s:guicolors[5] = "DarkMagenta" 54 let s:termguicolors[5] = "DarkMagenta"
55 let s:guicolors[6] = "DarkCyan" 55 let s:termguicolors[6] = "DarkCyan"
56 let s:guicolors[7] = "Gray" 56 let s:termguicolors[7] = "Gray"
57 let s:guicolors[8] = "DarkGray" 57 let s:termguicolors[8] = "DarkGray"
58 let s:guicolors[9] = "Red" 58 let s:termguicolors[9] = "Red"
59 let s:guicolors[10] = "Green" 59 let s:termguicolors[10] = "Green"
60 let s:guicolors[11] = "Yellow" 60 let s:termguicolors[11] = "Yellow"
61 let s:guicolors[12] = "Blue" 61 let s:termguicolors[12] = "Blue"
62 let s:guicolors[13] = "Magenta" 62 let s:termguicolors[13] = "Magenta"
63 let s:guicolors[14] = "Cyan" 63 let s:termguicolors[14] = "Cyan"
64 let s:guicolors[15] = "White" 64 let s:termguicolors[15] = "White"
65 65
66 let xterm_palette = ["00", "5f", "87", "af", "d7", "ff"] 66 let xterm_palette = ["00", "5f", "87", "af", "d7", "ff"]
67 67
68 let cur_col = 16 68 let cur_col = 16
69 69
70 for r in xterm_palette 70 for r in xterm_palette
71 for g in xterm_palette 71 for g in xterm_palette
72 for b in xterm_palette 72 for b in xterm_palette
73 let s:guicolors[cur_col] = '#' . r . g . b 73 let s:termguicolors[cur_col] = '#' . r . g . b
74 let cur_col += 1 74 let cur_col += 1
75 endfor 75 endfor
76 endfor 76 endfor
77 endfor 77 endfor
78 78
79 for i in range(24) 79 for i in range(24)
80 let g = i * 0xa + 8 80 let g = i * 0xa + 8
81 let s:guicolors[i + 232] = '#' . g . g . g 81 let s:termguicolors[i + 232] = '#' . g . g . g
82 endfor 82 endfor
83 endfunction 83 endfunction
84 84
85 function! s:get_hi_str(color, place) abort 85 function! s:get_hi_str(color, place) abort
86 if a:color >= 0 && a:color <= 255 86 if a:color >= 0 && a:color <= 255
87 if has('gui_running') 87 if has('gui_running')
88 return ' gui' . a:place . '=' . s:guicolors[a:color] 88 return ' gui' . a:place . '=' . s:termguicolors[a:color]
89 elseif a:color <= 7 || &t_Co == 256 || &t_Co == 88 89 elseif a:color <= 7 || &t_Co == 256 || &t_Co == 88
90 return ' cterm' . a:place . '=' . a:color 90 return ' cterm' . a:place . '=' . a:color
91 endif 91 endif
92 endif 92 endif
93 return '' 93 return ''