Skip to content

Commit cb55fde

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

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

lua/astrocore/buffer.lua

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,8 @@ 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+
-- Check if it has a filename.
81+
if vim.api.nvim_buf_get_name(bufnr) == "" then return false end
8682

8783
local session_ignore = vim.tbl_get(astro.config, "sessions", "ignore") or {}
8884
if
@@ -91,7 +87,7 @@ function M.is_restorable(bufnr)
9187
then
9288
return false
9389
end
94-
return true
90+
return vim.bo[bufnr].buflisted
9591
end
9692

9793
--- Check if the current buffers form a valid session

0 commit comments

Comments
 (0)