fix: find parsers correctly

Explicitely installed parsers will not be found implicitely
This commit is contained in:
li 2020-12-06 03:48:31 +00:00 committed by Thomas Vigouroux
parent b090476aa4
commit 66d35f9357

View file

@ -407,6 +407,8 @@ function M.has_parser(lang)
local lang = lang or M.get_buf_lang(api.nvim_get_current_buf())
if not lang or #lang == 0 then return false end
-- HACK: nvim internal API
if vim._ts_has_language(lang) then return true end
return #parser_files[lang] > 0
end