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:
Iron-E 2020-12-05 17:37:56 -05:00
parent 0d9322aac7
commit a7a3bc11fe
No known key found for this signature in database
GPG Key ID: 19B71B7B7B021D22
1 changed files with 8 additions and 8 deletions

View File

@ -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