Skip to content

Commit b3bfbad

Browse files
Sina SiadatSina Siadat
authored andcommitted
Don't ask for saving :Shellpad buffers
1 parent 376309a commit b3bfbad

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lua/shellpad/notebook.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,10 @@ end
434434
-- handle. Used by :Shellpad with no path and by :Shell when invoked from a
435435
-- non-notebook buffer.
436436
M.open_new = function(starter_lines)
437-
local buf = vim.api.nvim_create_buf(true, false)
437+
-- scratch=true sets buftype=nofile, bufhidden=hide, swapfile=off so the
438+
-- buffer is throwaway: no "save changes?" prompt on close. The user can
439+
-- still persist it explicitly with `:w path` or `:saveas path`.
440+
local buf = vim.api.nvim_create_buf(true, true)
438441
if starter_lines and #starter_lines > 0 then
439442
vim.api.nvim_buf_set_lines(buf, 0, -1, false, starter_lines)
440443
end

0 commit comments

Comments
 (0)