fix(#11): work with failed filetypes
This commit is contained in:
parent
09257b8eaf
commit
d2c93deee3
1 changed files with 5 additions and 1 deletions
|
|
@ -1,7 +1,11 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
local function is_ic_buf(bufnr)
|
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)
|
return vim.tbl_contains(M.config.filetypes, filetype)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue