mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-18 01:38:57 +00:00
Fix TS query reload autocmds, fix #161
This commit is contained in:
@@ -367,9 +367,10 @@ function! s:treesitter_init_module() " {{{1
|
||||
augroup matchup_filetype_query
|
||||
au!
|
||||
autocmd FileType query
|
||||
\ autocmd! MatchupTreesitter BufWritePost <buffer>
|
||||
\ call v:lua.require('nvim-treesitter.third-party.query')
|
||||
\ .invalidate_query_file(expand('%:p'))
|
||||
\ augroup MatchupTreesitter|augroup END
|
||||
\|autocmd! MatchupTreesitter BufWritePost <buffer>
|
||||
\ call v:lua.require('treesitter-matchup.third-party.query')
|
||||
\.invalidate_query_file(expand('%:p'))
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
|
||||
8
lua/treesitter-matchup/third-party/query.lua
vendored
8
lua/treesitter-matchup/third-party/query.lua
vendored
@@ -197,10 +197,14 @@ end
|
||||
function M.iter_group_results(bufnr, query_group, root, root_lang)
|
||||
local buf_lang = parsers.get_buf_lang(bufnr)
|
||||
|
||||
if not buf_lang then return EMPTY_ITER end
|
||||
if not buf_lang then
|
||||
return EMPTY_ITER
|
||||
end
|
||||
|
||||
local parser = parsers.get_parser(bufnr, buf_lang)
|
||||
if not parser then return EMPTY_ITER end
|
||||
if not parser then
|
||||
return EMPTY_ITER
|
||||
end
|
||||
|
||||
if not root then
|
||||
local first_tree = parser:trees()[1]
|
||||
|
||||
Reference in New Issue
Block a user