Skip to content

Commit 2a2cc31

Browse files
committed
fix(buffer): require all restored files to have a filename and be listed
1 parent 1b9874f commit 2a2cc31

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

lua/astrocore/buffer.lua

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,10 @@ end
7777
function M.is_restorable(bufnr)
7878
if not M.is_valid(bufnr) or vim.bo[bufnr].bufhidden ~= "" then return false end
7979

80-
if vim.bo[bufnr].buftype == "" then
81-
-- Normal buffer, check if it listed.
82-
if not vim.bo[bufnr].buflisted then return false end
83-
-- Check if it has a filename.
84-
if vim.api.nvim_buf_get_name(bufnr) == "" then return false end
85-
end
80+
-- Normal buffer, check if it listed.
81+
if not vim.bo[bufnr].buflisted then return false end
82+
-- Check if it has a filename.
83+
if vim.api.nvim_buf_get_name(bufnr) == "" then return false end
8684

8785
local session_ignore = vim.tbl_get(astro.config, "sessions", "ignore") or {}
8886
if

0 commit comments

Comments
 (0)