aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim/lsp.lua')
-rw-r--r--runtime/lua/vim/lsp.lua17
1 files changed, 6 insertions, 11 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua
index 7e8c73ddb6..2d39f2d45d 100644
--- a/runtime/lua/vim/lsp.lua
+++ b/runtime/lua/vim/lsp.lua
@@ -1101,21 +1101,16 @@ function lsp.start_client(config)
return true
end
- local last_set_from = vim.fn.gettext('\n\tLast set from ')
- local line = vim.fn.gettext(' line ')
- local scriptname
-
- vim.api.nvim_buf_call(bufnr, function()
- scriptname = vim.fn
- .execute('verbose set ' .. option .. '?')
- :match(last_set_from .. '(.*)' .. line .. '%d+')
- end)
+ local info = vim.api.nvim_get_option_info2(option, { buf = bufnr })
+ local scriptinfo = vim.tbl_filter(function(e)
+ return e.sid == info.last_set_sid
+ end, vim.fn.getscriptinfo())
- if not scriptname then
+ if #scriptinfo ~= 1 then
return false
end
- return vim.startswith(vim.fn.expand(scriptname), vim.fn.expand('$VIMRUNTIME'))
+ return vim.startswith(scriptinfo[1].name, vim.fn.expand('$VIMRUNTIME'))
end
---@private