feat!: removed opts.options. Use vim.o.sessionoptions instead.

This commit is contained in:
Folke Lemaitre 2024-07-06 21:22:40 +02:00
parent 08af8fee77
commit eb5622edae
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
2 changed files with 3 additions and 11 deletions

View File

@ -1,17 +1,12 @@
local M = {}
---@class PersistenceOptions
---@field pre_save? fun()
---@field post_save? fun()
---@field pre_load? fun()
---@field post_load? fun()
---@class Persistence.Config
local defaults = {
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
}
---@type PersistenceOptions
---@type Persistence.Config
M.options = {}
function M.setup(opts)

View File

@ -70,10 +70,7 @@ function M.stop()
end
function M.save()
local tmp = vim.o.sessionoptions
vim.o.sessionoptions = table.concat(Config.options.options, ",")
vim.cmd("mks! " .. e(M.current or M.get_current()))
vim.o.sessionoptions = tmp
vim.cmd("mks! " .. e(M._current or M.current()))
end
function M.load(opt)