style(highlite): consistency improvements
In the project, there was inconsistent formatting when using the `table`-as-`StringBuilder` approach. This commit fixes that.
This commit is contained in:
parent
0d9322aac7
commit
a7a3bc11fe
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
local vim = vim
|
local vim = vim
|
||||||
local api = vim.api
|
local api = vim.api
|
||||||
local cmd = api.nvim_command
|
local exe = api.nvim_command
|
||||||
local fn = vim.fn
|
local fn = vim.fn
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
|
@ -27,7 +27,7 @@ local _TYPE_TABLE = 'table'
|
||||||
|
|
||||||
-- Determine which set of colors to use.
|
-- Determine which set of colors to use.
|
||||||
local _USE_HEX = vim.o.termguicolors
|
local _USE_HEX = vim.o.termguicolors
|
||||||
local _USE_256 = tonumber(vim.o.t_Co) >= 256
|
local _USE_256 = tonumber(vim.o.t_Co) > 255
|
||||||
or string.find(vim.env.TERM, '256')
|
or string.find(vim.env.TERM, '256')
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
|
@ -148,7 +148,7 @@ function highlite.highlight(highlight_group, attributes) -- {{{ †
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
cmd(table.concat(highlight_cmd))
|
exe(table.concat(highlight_cmd))
|
||||||
end --}}} ‡
|
end --}}} ‡
|
||||||
|
|
||||||
function highlite:highlight_terminal(terminal_ansi_colors)
|
function highlite:highlight_terminal(terminal_ansi_colors)
|
||||||
|
@ -176,10 +176,10 @@ return setmetatable(highlite, {
|
||||||
local color_name = vim.g.colors_name
|
local color_name = vim.g.colors_name
|
||||||
|
|
||||||
-- Clear the highlighting.
|
-- Clear the highlighting.
|
||||||
cmd('hi clear')
|
exe 'hi clear'
|
||||||
|
|
||||||
-- If the syntax has been enabled, reset it.
|
-- If the syntax has been enabled, reset it.
|
||||||
if fn.exists('syntax_on') then cmd('syntax reset') end
|
if fn.exists 'syntax_on' then exe 'syntax reset' end
|
||||||
|
|
||||||
-- replace the colors_name
|
-- replace the colors_name
|
||||||
vim.g.colors_name = color_name
|
vim.g.colors_name = color_name
|
||||||
|
|
Loading…
Reference in New Issue