From 3d26bc7ab0e8dfddc0f40c840a8f925dddc2fef6 Mon Sep 17 00:00:00 2001 From: Lukas Reineke Date: Sun, 1 Oct 2023 09:52:38 +0900 Subject: [PATCH] fix: empty filetype exclude fix #662 --- lua/ibl/utils.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/ibl/utils.lua b/lua/ibl/utils.lua index bd9e89a3..0405210b 100644 --- a/lua/ibl/utils.lua +++ b/lua/ibl/utils.lua @@ -89,11 +89,11 @@ end ---@param bufnr number M.get_filetypes = function(bufnr) - return vim.split( - vim.api.nvim_get_option_value("filetype", { buf = bufnr }), - ".", - { plain = true, trimempty = true } - ) + local filetype = vim.api.nvim_get_option_value("filetype", { buf = bufnr }) + if filetype == "" then + return { "" } + end + return vim.split(filetype, ".", { plain = true, trimempty = true }) end local has_end_reg = vim.regex "^\\s*\\(}\\|]\\|)\\|end\\)"