From e577f4ddb531ec5fa44f4b66e06381bb92a50242 Mon Sep 17 00:00:00 2001 From: Sassan Haradji Date: Sat, 12 Sep 2026 20:00:34 +0330 Subject: [PATCH] fix: avoid crashes bufnr is not a valid buffer --- lua/flatten/core.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/flatten/core.lua b/lua/flatten/core.lua index fbab76d..79b505b 100644 --- a/lua/flatten/core.lua +++ b/lua/flatten/core.lua @@ -343,7 +343,7 @@ function M.edit_files(opts) return false end - if bufnr then + if bufnr and vim.api.nvim_buf_is_valid(bufnr) then local ft = vim.bo[bufnr].filetype local block = config.block_for[ft] ~= nil or force_block