mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 10:49:08 +00:00
fix(win): use syntax as fallback for treesitter
This commit is contained in:
parent
56c528ca5d
commit
f3b69a617a
1 changed files with 8 additions and 3 deletions
|
@ -273,9 +273,14 @@ function M:show()
|
|||
end
|
||||
|
||||
local ft = vim.bo[self.buf].filetype
|
||||
local lang = ft and vim.treesitter.language.get_lang(ft)
|
||||
if lang and not vim.b[self.buf].ts_highlight and not pcall(vim.treesitter.start, self.buf, lang) and ft then
|
||||
vim.bo[self.buf].syntax = ft
|
||||
if ft then
|
||||
local lang = ft and vim.treesitter.language.get_lang(ft)
|
||||
if lang and not vim.b[self.buf].ts_highlight and not pcall(vim.treesitter.start, self.buf, lang) then
|
||||
lang = nil
|
||||
end
|
||||
if ft and not lang then
|
||||
vim.bo[self.buf].syntax = ft
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd("VimResized", {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue