summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/telescope/previewers/utils.lua8
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