fix(#11): work with failed filetypes

This commit is contained in:
Barrett Ruth 2023-05-15 14:53:07 -05:00
parent 09257b8eaf
commit d2c93deee3

View file

@ -1,7 +1,11 @@
local M = {}
local function is_ic_buf(bufnr)
local filetype = vim.api.nvim_buf_get_option(bufnr, 'filetype')
local ok, filetype = pcall(vim.api.nvim_buf_get_option, bufnr, 'filetype')
if not ok then
return false
end
return vim.tbl_contains(M.config.filetypes, filetype)
end