Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,10 @@ do
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

-- Enable syntax highlighting and other treesitter features
vim.treesitter.start(buf, language)

Expand Down