Skip to content

Commit

Permalink
fix: prevent treesitter from running on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Oct 28, 2024
1 parent 407f2d5 commit 9b9be31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lua/blink/cmp/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,9 @@ function utils.highlight_with_treesitter(bufnr, filetype, start_line, end_line)
if root_lang == nil then return end

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

trees:parse({ start_line, end_line })
if not trees then return end

trees:for_each_tree(function(tree, tstree)
local lang = tstree:lang()
Expand Down
1 change: 1 addition & 0 deletions lua/blink/cmp/windows/lib/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function win:get_buf()
self.buf = vim.api.nvim_create_buf(false, true)
vim.api.nvim_set_option_value('tabstop', 1, { buf = self.buf }) -- prevents tab widths from being unpredictable
vim.api.nvim_set_option_value('filetype', self.config.filetype, { buf = self.buf })
vim.treesitter.stop(self.buf)
end
return self.buf
end
Expand Down

0 comments on commit 9b9be31

Please sign in to comment.