diff --git a/lua/ibl/utils.lua b/lua/ibl/utils.lua index 33a3f796..bd9e89a3 100644 --- a/lua/ibl/utils.lua +++ b/lua/ibl/utils.lua @@ -96,10 +96,10 @@ M.get_filetypes = function(bufnr) ) end -local has_end_reg = vim.regex "^\\s*\\(}\\|]\\|)\\|end\\)" --[[@as vim.regex]] +local has_end_reg = vim.regex "^\\s*\\(}\\|]\\|)\\|end\\)" ---@param line string M.has_end = function(line) - if has_end_reg:match_str(line) ~= nil then + if has_end_reg and has_end_reg:match_str(line) ~= nil then return true end return false