mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
refactor(lsp): do not parse verbose output when overwriting options (#22810)
This commit is contained in:
parent
9d5cbd1b15
commit
999cb36c2b
@ -1101,21 +1101,16 @@ function lsp.start_client(config)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
local last_set_from = vim.fn.gettext('\n\tLast set from ')
|
local info = vim.api.nvim_get_option_info2(option, { buf = bufnr })
|
||||||
local line = vim.fn.gettext(' line ')
|
local scriptinfo = vim.tbl_filter(function(e)
|
||||||
local scriptname
|
return e.sid == info.last_set_sid
|
||||||
|
end, vim.fn.getscriptinfo())
|
||||||
|
|
||||||
vim.api.nvim_buf_call(bufnr, function()
|
if #scriptinfo ~= 1 then
|
||||||
scriptname = vim.fn
|
|
||||||
.execute('verbose set ' .. option .. '?')
|
|
||||||
:match(last_set_from .. '(.*)' .. line .. '%d+')
|
|
||||||
end)
|
|
||||||
|
|
||||||
if not scriptname then
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
return vim.startswith(vim.fn.expand(scriptname), vim.fn.expand('$VIMRUNTIME'))
|
return vim.startswith(scriptinfo[1].name, vim.fn.expand('$VIMRUNTIME'))
|
||||||
end
|
end
|
||||||
|
|
||||||
---@private
|
---@private
|
||||||
|
Loading…
Reference in New Issue
Block a user