fix: has ts (#374)
This commit is contained in:
@@ -64,24 +64,20 @@ end
|
|||||||
utils.regex_highlighter = function(_, ft)
|
utils.regex_highlighter = function(_, ft)
|
||||||
if has_filetype(ft) then
|
if has_filetype(ft) then
|
||||||
vim.cmd(':ownsyntax ' .. ft)
|
vim.cmd(':ownsyntax ' .. ft)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Attach ts highlighter
|
-- Attach ts highlighter
|
||||||
utils.ts_highlighter = function(bufnr, ft)
|
utils.ts_highlighter = function(bufnr, ft)
|
||||||
if has_filetype(ft) then
|
if has_ts and has_filetype(ft) then
|
||||||
local lang = ts_parsers.ft_to_lang(ft);
|
local lang = ts_parsers.ft_to_lang(ft);
|
||||||
if has_ts and ts_parsers.has_parser(lang) then
|
if ts_parsers.has_parser(lang) then
|
||||||
ts_highlight.attach(bufnr, lang)
|
ts_highlight.attach(bufnr, lang)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user