Skip to content

Commit

Permalink
fix: skip treesitter hl on nil lang
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Oct 21, 2024
1 parent 67fa41f commit cb9397c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lua/blink/cmp/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ function utils.highlight_with_treesitter(bufnr, filetype, start_line, end_line)
local Range = require('vim.treesitter._range')

local root_lang = vim.treesitter.language.get_lang(filetype)
if root_lang == nil then return end

local trees = vim.treesitter.get_parser(bufnr, root_lang)
trees:parse({ start_line, end_line })
if not trees then return end
Expand Down

0 comments on commit cb9397c

Please sign in to comment.