style(syntax): only use `[]` index where necessary
It interferes with sumenko_lua.
This commit is contained in:
parent
cac088df10
commit
94eda96eb8
|
@ -93,7 +93,7 @@ local function tohex(rgb) return string.format('#%06x', rgb) end
|
||||||
local function use_background_with(attributes)
|
local function use_background_with(attributes)
|
||||||
return setmetatable(
|
return setmetatable(
|
||||||
attributes[go.background],
|
attributes[go.background],
|
||||||
{['__index'] = attributes}
|
{__index = attributes}
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -116,10 +116,10 @@ function highlite.group(group_name)
|
||||||
|
|
||||||
return
|
return
|
||||||
{
|
{
|
||||||
['fg'] = group_definition.foreground and tohex(group_definition.foreground) or _NONE,
|
fg = group_definition.foreground and tohex(group_definition.foreground) or _NONE,
|
||||||
['bg'] = group_definition.background and tohex(group_definition.background) or _NONE,
|
bg = group_definition.background and tohex(group_definition.background) or _NONE,
|
||||||
['blend'] = group_definition.blend,
|
blend = group_definition.blend,
|
||||||
['style'] = style or _NONE
|
style = style or _NONE
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ function highlite:highlight_terminal(terminal_colors)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return setmetatable(highlite, {['__call'] = function(self, normal, highlights, terminal_colors)
|
return setmetatable(highlite, {__call = function(self, normal, highlights, terminal_colors)
|
||||||
-- function to resolve function highlight groups being defined by function calls.
|
-- function to resolve function highlight groups being defined by function calls.
|
||||||
local function resolve(tbl, key, resolve_links)
|
local function resolve(tbl, key, resolve_links)
|
||||||
local value = tbl[key]
|
local value = tbl[key]
|
||||||
|
@ -174,7 +174,7 @@ return setmetatable(highlite, {['__call'] = function(self, normal, highlights, t
|
||||||
if value_type == 'function' then -- call and cache the result; next time, if it isn't a function this step will be skipped
|
if value_type == 'function' then -- call and cache the result; next time, if it isn't a function this step will be skipped
|
||||||
tbl[key] = value(setmetatable({},
|
tbl[key] = value(setmetatable({},
|
||||||
{
|
{
|
||||||
['__index'] = function(_, inner_key) return resolve(tbl, inner_key, true) end
|
__index = function(_, inner_key) return resolve(tbl, inner_key, true) end
|
||||||
}))
|
}))
|
||||||
elseif resolve_links and value_type == _TYPE_STRING and not string.find(value, '^#') then
|
elseif resolve_links and value_type == _TYPE_STRING and not string.find(value, '^#') then
|
||||||
return resolve(tbl, value, resolve_links)
|
return resolve(tbl, value, resolve_links)
|
||||||
|
|
Loading…
Reference in New Issue