Skip to content

Commit 81b2c5f

Browse files
committed
fix: crash in preview on nvim 0.8
1 parent 6f9e105 commit 81b2c5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/oil/util.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ M.read_file_to_scratch_buffer = function(path, preview_method)
926926
return
927927
end
928928
local ft = vim.filetype.match({ filename = path, buf = bufnr })
929-
if ft and ft ~= "" then
929+
if ft and ft ~= "" and vim.treesitter.language.get_lang then
930930
local lang = vim.treesitter.language.get_lang(ft)
931931
if not pcall(vim.treesitter.start, bufnr, lang) then
932932
vim.bo[bufnr].syntax = ft

0 commit comments

Comments
 (0)