diff options
| author | Simon Hauser <Simon-Hauser@outlook.de> | 2020-12-31 11:50:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-31 11:50:39 +0100 |
| commit | 686d560fa50e130801d5bd64493d79f1c65e3f7c (patch) | |
| tree | 77c180036add169f91a6de637f171a75258729eb /lua | |
| parent | d72f73feebb1741e9acbd10ee23b3c1e0d5da5fa (diff) | |
fix: has ts (#374)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/telescope/previewers/utils.lua | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lua/telescope/previewers/utils.lua b/lua/telescope/previewers/utils.lua index ca41af5..2c36a76 100644 --- a/lua/telescope/previewers/utils.lua +++ b/lua/telescope/previewers/utils.lua @@ -64,24 +64,20 @@ end utils.regex_highlighter = function(_, ft) if has_filetype(ft) then vim.cmd(':ownsyntax ' .. ft) - return true end - return false end -- Attach ts highlighter 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); - if has_ts and ts_parsers.has_parser(lang) then + if ts_parsers.has_parser(lang) then ts_highlight.attach(bufnr, lang) - return true end end - return false end |
