Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lua/persistence/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ local defaults = {
-- Set to 0 to always save
need = 1,
branch = true, -- use git branch to save session
skip_on_args = false, -- skip saving session if arguments are passed
}

---@type Persistence.Config
Expand Down
9 changes: 9 additions & 0 deletions lua/persistence/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ function M.start()
end
end

if Config.options.skip_on_args then
local args = vim.fn.argv()
if type(args) == "table" and next(args) ~= nil then
return
elseif type(args) == "string" and args ~= "" then
return
end
end

M.save()
M.fire("SavePost")
end,
Expand Down