Browse Source

fix(config): set termguicolors on start, avoid a strange error that I was having

my-config
NTBBloodbath 3 years ago
parent
commit
0bad1c3693
No known key found for this signature in database GPG Key ID: 18D6730BC846AAC5
  1. 62
      lua/doom/core/config/init.lua

62
lua/doom/core/config/init.lua

@ -24,6 +24,11 @@ else
) )
end end
-- Set termguicolors on load
if vim.fn.has('vim_starting') then
vim.opt.termguicolors = true
end
-- {{{ Default doom_config values -- {{{ Default doom_config values
-- default_doom_config_values loads the default doom_config values -- default_doom_config_values loads the default doom_config values
@ -418,31 +423,38 @@ end
-- --
-- @param langs The list of languages in the doomrc -- @param langs The list of languages in the doomrc
M.install_servers = function(langs) M.install_servers = function(langs)
local lspinstall = require('lspinstall') -- selene: allow(undefined_variable)
local installed_servers = lspinstall.installed_servers() if
local available_servers = lspinstall.available_servers() packer_plugins
and packer_plugins['lspinstall']
for _, lang in ipairs(langs) do and packer_plugins['lspinstall'].loaded
local lang_str = lang then
lang = lang:gsub('%s+%+lsp', '') local lspinstall = require('lspinstall')
local installed_servers = lspinstall.installed_servers()
-- If the +lsp flag exists and the language server is not installed yet local available_servers = lspinstall.available_servers()
if
lang_str:find('%+lsp') for _, lang in ipairs(langs) do
and (not utils.has_value(installed_servers, lang)) local lang_str = lang
then lang = lang:gsub('%s+%+lsp', '')
-- Try to install the server only if there is a server available for
-- the language, oterwise raise a warning -- If the +lsp flag exists and the language server is not installed yet
if utils.has_value(available_servers, lang) then if
lspinstall.install_server(lang) lang_str:find('%+lsp')
else and (not utils.has_value(installed_servers, lang))
log.warn( then
'The language ' -- Try to install the server only if there is a server available for
.. lang -- the language, oterwise raise a warning
.. ' does not have a server, please remove the "+lsp" flag' if utils.has_value(available_servers, lang) then
) lspinstall.install_server(lang)
end else
end log.warn(
'The language '
.. lang
.. ' does not have a server, please remove the "+lsp" flag'
)
end
end
end
end end
end end

Loading…
Cancel
Save