fix(previewer): Cast filepath to string before matching for filetype (#2565)

This commit is contained in:
Liam Jarvis
2023-06-11 15:31:19 +09:00
committed by GitHub
parent 89ca726572
commit 37c5268578

View File

@@ -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