From 3711862977615a4e6cdfde0bb90dcb0efcbcccda Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Tue, 8 Sep 2026 14:15:08 -0400 Subject: [PATCH] Install the language first --- init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 5572e462..96371d39 100644 --- a/init.lua +++ b/init.lua @@ -954,11 +954,12 @@ do ---@param buf integer ---@param language string local function treesitter_try_attach(buf, language) + -- Check if a parser exists and load it + if not vim.treesitter.language.add(language) then return end + -- Check if the buffer is valid (might not be after install completes) if not vim.api.nvim_buf_is_valid(buf) then return end - -- Check if a parser exists and load it - if not vim.treesitter.language.add(language) then return end -- Enable syntax highlighting and other treesitter features vim.treesitter.start(buf, language)