perf(win): don't try highlighting snacks internal filetypes

This commit is contained in:
Folke Lemaitre 2024-11-10 09:20:12 +01:00
parent 166aed6c5d
commit eb8ab37f6a
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -369,7 +369,7 @@ function M:show()
-- syntax highlighting
local ft = self.opts.ft or vim.bo[self.buf].filetype
if ft and not vim.b[self.buf].ts_highlight and vim.bo[self.buf].syntax == "" then
if ft and not ft:find("^snacks_") and not vim.b[self.buf].ts_highlight and vim.bo[self.buf].syntax == "" then
local lang = vim.treesitter.language.get_lang(ft)
if not (lang and pcall(vim.treesitter.start, self.buf, lang)) then
vim.bo[self.buf].syntax = ft