From 7e46d955c77aea368b772dd49e2708bc6ad008ae Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Tue, 27 May 2025 16:14:39 +0200 Subject: [PATCH] Downgrade treesitter as the new version was causing issues (#1, #3, #4) --- nvim/dot-config/nvim/lazy-lock.json | 4 ++-- nvim/dot-config/nvim/lua/autocmds.lua | 20 ------------------- .../nvim/lua/plugins/treesitter.lua | 5 +++-- 3 files changed, 5 insertions(+), 24 deletions(-) diff --git a/nvim/dot-config/nvim/lazy-lock.json b/nvim/dot-config/nvim/lazy-lock.json index fb15649..c816c07 100644 --- a/nvim/dot-config/nvim/lazy-lock.json +++ b/nvim/dot-config/nvim/lazy-lock.json @@ -29,8 +29,8 @@ "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, "nvim-lspconfig": { "branch": "master", "commit": "3ea99227e316c5028f57a4d86a1a7fd01dd876d0" }, "nvim-surround": { "branch": "main", "commit": "0e62500b98f4513feaaf7425c135472457ea5b7d" }, - "nvim-treesitter": { "branch": "main", "commit": "c1dfc39285e4a11983dfbe556fb0be7f2a749977" }, - "nvim-treesitter-textobjects": { "branch": "main", "commit": "fa32a45fdbab9c9c3bda9ecec9b12dddb221b927" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "0f051e9813a36481f48ca1f833897210dbcfffde" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, "peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, diff --git a/nvim/dot-config/nvim/lua/autocmds.lua b/nvim/dot-config/nvim/lua/autocmds.lua index 753e98e..4126241 100644 --- a/nvim/dot-config/nvim/lua/autocmds.lua +++ b/nvim/dot-config/nvim/lua/autocmds.lua @@ -139,23 +139,3 @@ vim.api.nvim_create_autocmd("CursorMoved", { vim.diagnostic.config({ virtual_lines = false }) end, }) - --- Auto install treesitter parser and start them -vim.api.nvim_create_autocmd("FileType", { - desc = "Enable Treesitter", - group = vim.api.nvim_create_augroup("enable_treesitter", {}), - callback = function(event) - local has_treesitter, treesitter = pcall(require, "nvim-treesitter") - if has_treesitter then - local language = vim.treesitter.language.get_lang(event.match) - treesitter.install(language):await(function() - if pcall(vim.treesitter.start) then - -- Use Treesitter indentation and folds. - vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" - vim.wo.foldmethod = "expr" - vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" - end - end) - end - end, -}) diff --git a/nvim/dot-config/nvim/lua/plugins/treesitter.lua b/nvim/dot-config/nvim/lua/plugins/treesitter.lua index f35b58b..2cc0275 100644 --- a/nvim/dot-config/nvim/lua/plugins/treesitter.lua +++ b/nvim/dot-config/nvim/lua/plugins/treesitter.lua @@ -3,12 +3,13 @@ return { -- Highlight, edit, and navigate code "nvim-treesitter/nvim-treesitter", dependencies = { - { "nvim-treesitter/nvim-treesitter-textobjects", branch = "main" }, + { "nvim-treesitter/nvim-treesitter-textobjects", branch = "master" }, "windwp/nvim-ts-autotag", }, lazy = false, - branch = "main", + branch = "master", build = ":TSUpdate", + main = "nvim-treesitter.configs", opts = { ensure_installed = require("tools.highlight"),