Skip to content

Commit 9b9be31

Browse files
committed
fix: prevent treesitter from running on windows
1 parent 407f2d5 commit 9b9be31

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lua/blink/cmp/utils.lua

+1-2
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,9 @@ function utils.highlight_with_treesitter(bufnr, filetype, start_line, end_line)
9292
if root_lang == nil then return end
9393

9494
local success, trees = pcall(vim.treesitter.get_parser, bufnr, root_lang)
95-
if not success then return end
95+
if not success or not trees then return end
9696

9797
trees:parse({ start_line, end_line })
98-
if not trees then return end
9998

10099
trees:for_each_tree(function(tree, tstree)
101100
local lang = tstree:lang()

lua/blink/cmp/windows/lib/init.lua

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ function win:get_buf()
4242
self.buf = vim.api.nvim_create_buf(false, true)
4343
vim.api.nvim_set_option_value('tabstop', 1, { buf = self.buf }) -- prevents tab widths from being unpredictable
4444
vim.api.nvim_set_option_value('filetype', self.config.filetype, { buf = self.buf })
45+
vim.treesitter.stop(self.buf)
4546
end
4647
return self.buf
4748
end

0 commit comments

Comments
 (0)