Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
8484fdaa28 | |||
8c40aa7b80 | |||
70c281e54e | |||
7421e30704 | |||
5453a25028 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,3 +4,5 @@ doc/tags
|
||||
debug
|
||||
.repro
|
||||
foo.*
|
||||
*.log
|
||||
data
|
||||
|
@ -1,5 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## [1.0.1](https://github.com/folke/persistence.nvim/compare/v1.0.0...v1.0.1) (2023-01-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* dont throw error when session was already stopped ([70c281e](https://github.com/folke/persistence.nvim/commit/70c281e54e34630d8bef9b1cf9f7a0ac3edd6a1c))
|
||||
|
||||
## 1.0.0 (2023-01-04)
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
## ⚡️ Requirements
|
||||
|
||||
- Neovim >= 0.5.0
|
||||
- Neovim >= 0.7.2
|
||||
|
||||
## 📦 Installation
|
||||
|
||||
@ -50,7 +50,7 @@ Persistence comes with the following defaults:
|
||||
|
||||
```lua
|
||||
{
|
||||
dir = vim.fn.expand(vim.fn.stdpath("config") .. "/sessions/"), -- directory where session files are saved
|
||||
dir = vim.fn.expand(vim.fn.stdpath("state") .. "/sessions/"), -- directory where session files are saved
|
||||
options = { "buffers", "curdir", "tabpages", "winsize" }, -- sessionoptions used for saving
|
||||
}
|
||||
```
|
||||
|
@ -1,4 +1,4 @@
|
||||
*persistence.nvim.txt* For Neovim >= 0.8.0 Last change: 2023 January 04
|
||||
*persistence.nvim.txt* For Neovim >= 0.8.0 Last change: 2023 January 06
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *persistence.nvim-table-of-contents*
|
||||
@ -25,7 +25,7 @@ FEATURES *persistence.nvim-features*
|
||||
REQUIREMENTS *persistence.nvim-requirements*
|
||||
|
||||
|
||||
- Neovim >= 0.5.0
|
||||
- Neovim >= 0.7.2
|
||||
|
||||
|
||||
INSTALLATION *persistence.nvim-installation*
|
||||
@ -69,7 +69,7 @@ Persistence comes with the following defaults:
|
||||
|
||||
>lua
|
||||
{
|
||||
dir = vim.fn.expand(vim.fn.stdpath("config") .. "/sessions/"), -- directory where session files are saved
|
||||
dir = vim.fn.expand(vim.fn.stdpath("state") .. "/sessions/"), -- directory where session files are saved
|
||||
options = { "buffers", "curdir", "tabpages", "winsize" }, -- sessionoptions used for saving
|
||||
}
|
||||
<
|
||||
|
@ -69,7 +69,7 @@ Persistence comes with the following defaults:
|
||||
|
||||
>
|
||||
{
|
||||
dir = vim.fn.expand(vim.fn.stdpath("config") .. "/sessions/"), -- directory where session files are saved
|
||||
dir = vim.fn.expand(vim.fn.stdpath("state") .. "/sessions/"), -- directory where session files are saved
|
||||
options = { "buffers", "curdir", "tabpages", "winsize" }, -- sessionoptions used for saving
|
||||
}
|
||||
<
|
||||
|
@ -27,19 +27,16 @@ function M.setup(opts)
|
||||
end
|
||||
|
||||
function M.start()
|
||||
vim.cmd([[
|
||||
augroup Persistence
|
||||
autocmd!
|
||||
autocmd VimLeavePre * lua require("persistence").save()
|
||||
augroup end
|
||||
]])
|
||||
vim.api.nvim_create_autocmd("VimLeavePre", {
|
||||
group = vim.api.nvim_create_augroup("persistence", { clear = true }),
|
||||
callback = function()
|
||||
M.save()
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
function M.stop()
|
||||
vim.cmd([[
|
||||
autocmd! Persistence
|
||||
augroup! Persistence
|
||||
]])
|
||||
pcall(vim.api.nvim_del_augroup_by_name, "persistence")
|
||||
end
|
||||
|
||||
function M.save()
|
||||
|
Reference in New Issue
Block a user