We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6f9e105 commit 81b2c5fCopy full SHA for 81b2c5f
lua/oil/util.lua
@@ -926,7 +926,7 @@ M.read_file_to_scratch_buffer = function(path, preview_method)
926
return
927
end
928
local ft = vim.filetype.match({ filename = path, buf = bufnr })
929
- if ft and ft ~= "" then
+ if ft and ft ~= "" and vim.treesitter.language.get_lang then
930
local lang = vim.treesitter.language.get_lang(ft)
931
if not pcall(vim.treesitter.start, bufnr, lang) then
932
vim.bo[bufnr].syntax = ft
0 commit comments