feat!: removed opts.options
. Use vim.o.sessionoptions
instead.
This commit is contained in:
parent
08af8fee77
commit
eb5622edae
@ -1,17 +1,12 @@
|
|||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
---@class PersistenceOptions
|
---@class Persistence.Config
|
||||||
---@field pre_save? fun()
|
|
||||||
---@field post_save? fun()
|
|
||||||
---@field pre_load? fun()
|
|
||||||
---@field post_load? fun()
|
|
||||||
local defaults = {
|
local defaults = {
|
||||||
dir = vim.fn.stdpath("state") .. "/sessions/", -- directory where session files are saved
|
dir = vim.fn.stdpath("state") .. "/sessions/", -- directory where session files are saved
|
||||||
options = { "buffers", "curdir", "tabpages", "winsize", "skiprtp" }, -- sessionoptions used for saving
|
|
||||||
save_empty = false, -- don't save if there are no open file buffers
|
save_empty = false, -- don't save if there are no open file buffers
|
||||||
}
|
}
|
||||||
|
|
||||||
---@type PersistenceOptions
|
---@type Persistence.Config
|
||||||
M.options = {}
|
M.options = {}
|
||||||
|
|
||||||
function M.setup(opts)
|
function M.setup(opts)
|
||||||
|
@ -70,10 +70,7 @@ function M.stop()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M.save()
|
function M.save()
|
||||||
local tmp = vim.o.sessionoptions
|
vim.cmd("mks! " .. e(M._current or M.current()))
|
||||||
vim.o.sessionoptions = table.concat(Config.options.options, ",")
|
|
||||||
vim.cmd("mks! " .. e(M.current or M.get_current()))
|
|
||||||
vim.o.sessionoptions = tmp
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.load(opt)
|
function M.load(opt)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user