diff options
| author | oberblastmeister <61095988+oberblastmeister@users.noreply.github.com> | 2021-01-28 13:56:55 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-28 19:56:55 +0100 |
| commit | 64ffea57f4280df3f7313ead41a589d8151115bc (patch) | |
| tree | ac4b2528582a1a308b4f77b9f58e22f4d40badb4 /plugin | |
| parent | fix(lua): correctly handle do_statement in locals (diff) | |
| download | nvim-treesitter-64ffea57f4280df3f7313ead41a589d8151115bc.tar nvim-treesitter-64ffea57f4280df3f7313ead41a589d8151115bc.tar.gz nvim-treesitter-64ffea57f4280df3f7313ead41a589d8151115bc.tar.bz2 nvim-treesitter-64ffea57f4280df3f7313ead41a589d8151115bc.tar.lz nvim-treesitter-64ffea57f4280df3f7313ead41a589d8151115bc.tar.xz nvim-treesitter-64ffea57f4280df3f7313ead41a589d8151115bc.tar.zst nvim-treesitter-64ffea57f4280df3f7313ead41a589d8151115bc.zip | |
feat(query): add cache for get_query (#879)
* added cached to get_query
* added reload function
* fixed message
* added autocommand to reload cache on bufwrite for query file
* pass filename to autocommand v:lua fn
* removed comment
* added metatable
* fixed loop
* Update lua/nvim-treesitter/query.lua
Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
* Update lua/nvim-treesitter/query.lua
Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
* added do ... end to local query_cache
* made line shorter
Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/nvim-treesitter.vim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/plugin/nvim-treesitter.vim b/plugin/nvim-treesitter.vim index 97b685e43..19b88fb37 100644 --- a/plugin/nvim-treesitter.vim +++ b/plugin/nvim-treesitter.vim @@ -5,6 +5,9 @@ if exists('g:loaded_nvim_treesitter') endif augroup NvimTreesitter + " on every query file write we want to set an autocommand that will reload the cache + autocmd FileType query + \ autocmd! NvimTreesitter BufWritePost <buffer> call v:lua.require('nvim-treesitter.query').reload_file_cache_on_write(expand('%:p')) augroup END let g:loaded_nvim_treesitter = 1 |
