From 37c526857807e9550bdc8649700d4ceb47750ef2 Mon Sep 17 00:00:00 2001 From: Liam Jarvis Date: Sun, 11 Jun 2023 15:31:19 +0900 Subject: [PATCH] fix(previewer): Cast filepath to string before matching for filetype (#2565) --- lua/telescope/previewers/utils.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/telescope/previewers/utils.lua b/lua/telescope/previewers/utils.lua index 06b4cb2..ba4e444 100644 --- a/lua/telescope/previewers/utils.lua +++ b/lua/telescope/previewers/utils.lua @@ -33,6 +33,10 @@ local detect_from_modeline = function(p) end utils.filetype_detect = function(filepath) + if type(filepath) ~= string then + filepath = tostring(filepath) + end + local match = vim.filetype.match { filename = filepath } if match and match ~= "" then return match