merge master

neovim_0.7
ray-x 2 years ago
parent 21ddd7f2f6
commit c7872c83a8

@ -6,11 +6,11 @@ local uv = vim.loop
local empty = util.empty local empty = util.empty
local warn = util.warn local warn = util.warn
_NG_Loaded = {} _NG_Loaded = {}
_LoadedFiletypes = {} _LoadedFiletypes = {}
local loader = nil local loader = nil
packer_plugins = packer_plugins or nil -- suppress warnings packer_plugins = packer_plugins or nil -- suppress warnings
trace = log
-- packer only -- packer only
local highlight = require('navigator.lspclient.highlight') local highlight = require('navigator.lspclient.highlight')
@ -501,11 +501,11 @@ local function lsp_startup(ft, retry, user_lsp_opts)
log(lspclient, config.lsp.disable_format_cap) log(lspclient, config.lsp.disable_format_cap)
if vim.tbl_contains(config.lsp.disable_format_cap or {}, lspclient) then if vim.tbl_contains(config.lsp.disable_format_cap or {}, lspclient) then
trace('fileformat disabled for ', lspclient) log('fileformat disabled for ', lspclient)
disable_fmt = true disable_fmt = true
end end
cfg = vim.tbl_deep_extend('force', cfg, user_lsp_opts[lspclient]) cfg = vim.tbl_deep_extend('force', cfg, user_lsp_opts[lspclient])
if config.combined_attach == nil or config.combined_attach == 'their' then if config.combined_attach == nil then
cfg.on_attach = function(client, bufnr) cfg.on_attach = function(client, bufnr)
on_attach(client, bufnr) on_attach(client, bufnr)
if disable_fmt then if disable_fmt then
@ -555,7 +555,7 @@ local function lsp_startup(ft, retry, user_lsp_opts)
if has_lspinst and _NgConfigValues.lsp_installer then if has_lspinst and _NgConfigValues.lsp_installer then
local installed, installer_cfg = require('nvim-lsp-installer.servers').get_server(lspconfig[lspclient].name) local installed, installer_cfg = require('nvim-lsp-installer.servers').get_server(lspconfig[lspclient].name)
log('lsp installer server config' .. lspconfig[lspclient].name, installer_cfg) log('lsp installer server config' .. lspconfig[lspclient].name , installer_cfg)
if installed and installer_cfg then if installed and installer_cfg then
log('options', installer_cfg:get_default_options()) log('options', installer_cfg:get_default_options())
-- if cfg.cmd / {lsp_server_name, arg} not present or lsp_server_name is not in PATH -- if cfg.cmd / {lsp_server_name, arg} not present or lsp_server_name is not in PATH
@ -644,13 +644,11 @@ local function setup(user_opts)
local disable_ft = { local disable_ft = {
'NvimTree', 'NvimTree',
'guihua', 'guihua',
'notify',
'clap_input', 'clap_input',
'clap_spinner', 'clap_spinner',
'vista', 'vista',
'vista_kind', 'vista_kind',
'TelescopePrompt', 'TelescopePrompt',
'TelescopeResults',
'guihua_rust', 'guihua_rust',
'csv', 'csv',
'txt', 'txt',
@ -659,13 +657,13 @@ local function setup(user_opts)
} }
for i = 1, #disable_ft do for i = 1, #disable_ft do
if ft == disable_ft[i] or _LoadedFiletypes[ft] then if ft == disable_ft[i] or _LoadedFiletypes[ft] then
log('navigator disabled for ft or it is loaded', ft) trace('navigator disabled for ft or it is loaded', ft)
return return
end end
end end
if user_opts ~= nil then if user_opts ~= nil then
trace('navigator user setup', user_opts) log('navigator user setup', user_opts)
end end
trace(debug.traceback()) trace(debug.traceback())
if #vim.lsp.buf_get_clients() > 0 and user_opts == nil then if #vim.lsp.buf_get_clients() > 0 and user_opts == nil then
@ -740,8 +738,8 @@ function on_filetype()
log(uri) log(uri)
local wids = vim.fn.win_findbuf(bufnr) local wids = vim.fn.win_findbuf(bufnr)
if empty(wins) == 1 then if empty(wins) then
log('buf not shown return', winds, empty(winds)) log('buf not shown return')
end end
setup() setup()
end end

Loading…
Cancel
Save