diff options
Diffstat (limited to 'runtime/lua')
-rw-r--r-- | runtime/lua/vim/lsp.lua | 16 | ||||
-rw-r--r-- | runtime/lua/vim/treesitter.lua | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index 39665a3d4f..7e8c73ddb6 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -1101,21 +1101,21 @@ function lsp.start_client(config) return true end - local old_bufnr = vim.fn.bufnr('') local last_set_from = vim.fn.gettext('\n\tLast set from ') local line = vim.fn.gettext(' line ') + local scriptname - vim.cmd.buffer(bufnr) - local scriptname = vim.fn - .execute('verbose set ' .. option .. '?') - :match(last_set_from .. '(.*)' .. line .. '%d+') - vim.cmd.buffer(old_bufnr) + vim.api.nvim_buf_call(bufnr, function() + scriptname = vim.fn + .execute('verbose set ' .. option .. '?') + :match(last_set_from .. '(.*)' .. line .. '%d+') + end) if not scriptname then return false end - local vimruntime = vim.fn.getenv('VIMRUNTIME') - return vim.startswith(vim.fn.expand(scriptname), vim.fn.expand(vimruntime)) + + return vim.startswith(vim.fn.expand(scriptname), vim.fn.expand('$VIMRUNTIME')) end ---@private diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua index 56000f99a8..43b8c11b80 100644 --- a/runtime/lua/vim/treesitter.lua +++ b/runtime/lua/vim/treesitter.lua @@ -439,7 +439,7 @@ end --- - winid (integer|nil): Window id to display the tree buffer in. If omitted, --- a new window is created with {command}. --- - command (string|nil): Vimscript command to create the window. Default ---- value is "topleft 60vnew". Only used when {winid} is nil. +--- value is "60vnew". Only used when {winid} is nil. --- - title (string|fun(bufnr:integer):string|nil): Title of the window. If a --- function, it accepts the buffer number of the source buffer as its only --- argument and should return a string. @@ -465,7 +465,7 @@ function M.inspect_tree(opts) local w = opts.winid if not w then - vim.cmd(opts.command or 'topleft 60vnew') + vim.cmd(opts.command or '60vnew') w = a.nvim_get_current_win() end |