highlighter: fix a couple of vim9script errors and fix indentation

This commit is contained in:
Christian 2020-11-18 13:55:05 +01:00 committed by Christian Brabandt
parent 9f7557df44
commit 0d0c380940
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -553,8 +553,8 @@ else
# if a group is in both modes available, only define the second # if a group is in both modes available, only define the second
# that is how this was done previously overwrite the previous definition # that is how this was done previously overwrite the previous definition
for mode in reverse(mapped) for mode in reverse(mapped)
if exists('g:airline#themes#' .. g:airline_theme .. '#palette[mode]') if exists('g:airline#themes#' .. g:airline_theme .. '#palette.' .. mode)
dict = eval('g:airline#themes#' .. g:airline_theme .. '#palette[' .. mode .. ']') dict = eval('g:airline#themes#' .. g:airline_theme .. '#palette.' .. mode)
for kvp in items(dict) for kvp in items(dict)
var mode_colors = kvp[1] var mode_colors = kvp[1]
var name = kvp[0] var name = kvp[0]
@ -591,8 +591,10 @@ else
if p.accents[accent][0] != '' if p.accents[accent][0] != ''
colors[0] = p.accents[accent][0] colors[0] = p.accents[accent][0]
endif endif
if p.accents[accent][2] != '' if type(get(p.accents[accent], 2, '')) == type('')
colors[2] = p.accents[accent][2] colors[2] = get(p.accents[accent], 2, '')
else
colors[2] = string(p.accents[accent][2])
endif endif
if len(colors) >= 5 if len(colors) >= 5
colors[4] = get(p.accents[accent], 4, '') colors[4] = get(p.accents[accent], 4, '')