diff options
| author | Lewis Russell <lewis6991@gmail.com> | 2023-06-12 16:18:25 +0100 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2025-05-12 18:43:40 +0200 |
| commit | 934b751f9d1075ef31cdbcd5e1342fe96396c74d (patch) | |
| tree | 1ad7181f386ea9338af9273f2056c73b8a833d5c | |
| parent | fix: filter languages through parser.configs (diff) | |
| download | nvim-treesitter-934b751f9d1075ef31cdbcd5e1342fe96396c74d.tar nvim-treesitter-934b751f9d1075ef31cdbcd5e1342fe96396c74d.tar.gz nvim-treesitter-934b751f9d1075ef31cdbcd5e1342fe96396c74d.tar.bz2 nvim-treesitter-934b751f9d1075ef31cdbcd5e1342fe96396c74d.tar.lz nvim-treesitter-934b751f9d1075ef31cdbcd5e1342fe96396c74d.tar.xz nvim-treesitter-934b751f9d1075ef31cdbcd5e1342fe96396c74d.tar.zst nvim-treesitter-934b751f9d1075ef31cdbcd5e1342fe96396c74d.zip | |
fix: check queries in needs_update()
| -rw-r--r-- | lua/nvim-treesitter/install.lua | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 11dfe1a90..af95fdeed 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -111,7 +111,16 @@ end ---@return boolean local function needs_update(lang) local revision = get_target_revision(lang) - return not revision or revision ~= get_installed_revision(lang) + if revision then + return revision ~= get_installed_revision(lang) + end + + -- No revision. Check the queries link to the same place + + local queries = fs.joinpath(config.get_install_dir('queries'), lang) + local queries_src = M.get_package_path('runtime', 'queries', lang) + + return uv.fs_realpath(queries) ~= uv.fs_realpath(queries_src) end --- |
