neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 4349bdbd0bd0096b4f4bea0feda0961e3b03f3cc
parent 4f9311b759fff0371433fb5b5355fccb001d54e7
Author: Riley Bruins <ribru17@hotmail.com>
Date:   Fri, 27 Sep 2024 18:08:05 -0700

fix(treesitter): specify success status in edit_query return value

Diffstat:
Mruntime/lua/vim/treesitter/dev.lua | 4++++
Mruntime/lua/vim/treesitter/query.lua | 6+-----
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/runtime/lua/vim/treesitter/dev.lua b/runtime/lua/vim/treesitter/dev.lua @@ -579,6 +579,8 @@ end --- @private --- @param lang? string language to open the query editor for. +--- @return boolean? `true` on success, `nil` on failure +--- @return string? error message, if applicable function M.edit_query(lang) local buf = api.nvim_get_current_buf() local win = api.nvim_get_current_win() @@ -678,6 +680,8 @@ function M.edit_query(lang) }) vim.cmd('normal! G') vim.cmd.startinsert() + + return true end return M diff --git a/runtime/lua/vim/treesitter/query.lua b/runtime/lua/vim/treesitter/query.lua @@ -1028,11 +1028,7 @@ end --- --- @param lang? string language to open the query editor for. If omitted, inferred from the current buffer's filetype. function M.edit(lang) - -- TODO(ribru17): Make edit_query return true upon success so we can just assert here - local _, err_msg = vim.treesitter.dev.edit_query(lang) - if err_msg then - error(err_msg) - end + assert(vim.treesitter.dev.edit_query(lang)) end return M