aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake.deps/CMakeLists.txt4
-rw-r--r--runtime/doc/treesitter.txt4
-rw-r--r--runtime/lua/vim/lsp.lua16
-rw-r--r--runtime/lua/vim/treesitter.lua4
-rw-r--r--runtime/plugin/nvim.lua15
-rw-r--r--src/nvim/cmdexpand.c5
-rw-r--r--src/nvim/lua/executor.c6
7 files changed, 29 insertions, 25 deletions
diff --git a/cmake.deps/CMakeLists.txt b/cmake.deps/CMakeLists.txt
index b1a843ddc8..48a96b1bd8 100644
--- a/cmake.deps/CMakeLists.txt
+++ b/cmake.deps/CMakeLists.txt
@@ -169,8 +169,8 @@ set(WINTOOLS_SHA256 3c4c490a3d392ceeb1347cb77cc821a31900b688a2189276d3a1131a3f21
set(WINGUI_URL https://github.com/equalsraf/neovim-qt/releases/download/v0.2.17/neovim-qt.zip)
set(WINGUI_SHA256 502e386eef677c2c2e0c11d8cbb27f3e12b4d96818369417e8da4129c4580c25)
-set(WIN32YANK_X86_64_URL https://github.com/equalsraf/win32yank/releases/download/v0.0.4/win32yank-x64.zip)
-set(WIN32YANK_X86_64_SHA256 33a747a92da60fb65e668edbf7661d3d902411a2d545fe9dc08623cecd142a20)
+set(WIN32YANK_X86_64_URL https://github.com/equalsraf/win32yank/releases/download/v0.1.1/win32yank-x64.zip)
+set(WIN32YANK_X86_64_SHA256 247c9a05b94387a884b49d3db13f806b1677dfc38020f955f719be6902260cd6)
set(GETTEXT_URL https://ftp.gnu.org/pub/gnu/gettext/gettext-0.20.1.tar.gz)
set(GETTEXT_SHA256 66415634c6e8c3fa8b71362879ec7575e27da43da562c798a8a2f223e6e47f5c)
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index ddca307e74..46f414d905 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -623,8 +623,8 @@ inspect_tree({opts}) *vim.treesitter.inspect_tree()*
• 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.
+ window. Default 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
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
diff --git a/runtime/plugin/nvim.lua b/runtime/plugin/nvim.lua
index e4b099f7ad..0a33826b82 100644
--- a/runtime/plugin/nvim.lua
+++ b/runtime/plugin/nvim.lua
@@ -6,6 +6,15 @@ vim.api.nvim_create_user_command('Inspect', function(cmd)
end
end, { desc = 'Inspect highlights and extmarks at the cursor', bang = true })
-vim.api.nvim_create_user_command('InspectTree', function()
- vim.treesitter.inspect_tree()
-end, { desc = 'Inspect treesitter language tree for buffer' })
+vim.api.nvim_create_user_command('InspectTree', function(cmd)
+ if cmd.mods ~= '' or cmd.count ~= 0 then
+ local count = cmd.count ~= 0 and cmd.count or ''
+ local new = cmd.mods ~= '' and 'new' or 'vnew'
+
+ vim.treesitter.inspect_tree({
+ command = ('%s %s%s'):format(cmd.mods, count, new),
+ })
+ else
+ vim.treesitter.inspect_tree()
+ end
+end, { desc = 'Inspect treesitter language tree for buffer', count = true })
diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c
index 18d35e1e20..220cb4cf93 100644
--- a/src/nvim/cmdexpand.c
+++ b/src/nvim/cmdexpand.c
@@ -1206,7 +1206,6 @@ char *addstar(char *fname, size_t len, int context)
// For help tags the translation is done in find_help_tags().
// For a tag pattern starting with "/" no translation is needed.
if (context == EXPAND_HELP
- || context == EXPAND_CHECKHEALTH
|| context == EXPAND_COLORS
|| context == EXPAND_COMPILER
|| context == EXPAND_OWNSYNTAX
@@ -1214,7 +1213,9 @@ char *addstar(char *fname, size_t len, int context)
|| context == EXPAND_PACKADD
|| context == EXPAND_RUNTIME
|| ((context == EXPAND_TAGS_LISTFILES || context == EXPAND_TAGS)
- && fname[0] == '/')) {
+ && fname[0] == '/')
+ || context == EXPAND_CHECKHEALTH
+ || context == EXPAND_LUA) {
retval = xstrnsave(fname, len);
} else {
new_len = len + 2; // +2 for '^' at start, NUL at end
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index 819e3cccff..3616f1f69f 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -1857,12 +1857,6 @@ int nlua_expand_pat(expand_T *xp, char *pat, int *num_results, char ***results)
lua_getfield(lstate, -1, "_expand_pat");
luaL_checktype(lstate, -1, LUA_TFUNCTION);
- // ex expansion prepends a ^, but don't worry, it is not a regex
- if (pat[0] != '^') {
- return FAIL;
- }
- pat++;
-
// [ vim, vim._expand_pat, buf ]
lua_pushlstring(lstate, (const char *)pat, strlen(pat));