chore: rename autocmd group
parent
df231232c7
commit
2105556a1a
|
|
@ -77,6 +77,7 @@ end
|
||||||
|
|
||||||
---Setup the plugin based on the intersect of the default and the user's config
|
---Setup the plugin based on the intersect of the default and the user's config
|
||||||
---@param opts table
|
---@param opts table
|
||||||
|
---@param opts? table
|
||||||
---@return nil
|
---@return nil
|
||||||
function M.setup(opts)
|
function M.setup(opts)
|
||||||
config.setup(opts)
|
config.setup(opts)
|
||||||
|
|
@ -125,8 +126,9 @@ end
|
||||||
---Start recording a session and write to disk on a specific autocommand
|
---Start recording a session and write to disk on a specific autocommand
|
||||||
---@return nil
|
---@return nil
|
||||||
function M.start()
|
function M.start()
|
||||||
|
vim.api.nvim_create_augroup("Persisted", { clear = true })
|
||||||
vim.api.nvim_create_autocmd(config.options.command, {
|
vim.api.nvim_create_autocmd(config.options.command, {
|
||||||
group = vim.api.nvim_create_augroup("PersistedGroup", { clear = true }),
|
group = "Persisted",
|
||||||
callback = function()
|
callback = function()
|
||||||
require("persisted").save()
|
require("persisted").save()
|
||||||
end,
|
end,
|
||||||
|
|
@ -138,8 +140,8 @@ end
|
||||||
---@return nil
|
---@return nil
|
||||||
function M.stop()
|
function M.stop()
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
autocmd! PersistedGroup
|
autocmd! Persisted
|
||||||
augroup! PersistedGroup
|
augroup! Persisted
|
||||||
]])
|
]])
|
||||||
vim.g.persisting = false
|
vim.g.persisting = false
|
||||||
vim.g.persisting_session = nil
|
vim.g.persisting_session = nil
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue