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
|
debug
|
||||||
.repro
|
.repro
|
||||||
foo.*
|
foo.*
|
||||||
|
*.log
|
||||||
|
data
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# 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)
|
## 1.0.0 (2023-01-04)
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
## ⚡️ Requirements
|
## ⚡️ Requirements
|
||||||
|
|
||||||
- Neovim >= 0.5.0
|
- Neovim >= 0.7.2
|
||||||
|
|
||||||
## 📦 Installation
|
## 📦 Installation
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ Persistence comes with the following defaults:
|
|||||||
|
|
||||||
```lua
|
```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
|
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*
|
Table of Contents *persistence.nvim-table-of-contents*
|
||||||
@ -25,7 +25,7 @@ FEATURES *persistence.nvim-features*
|
|||||||
REQUIREMENTS *persistence.nvim-requirements*
|
REQUIREMENTS *persistence.nvim-requirements*
|
||||||
|
|
||||||
|
|
||||||
- Neovim >= 0.5.0
|
- Neovim >= 0.7.2
|
||||||
|
|
||||||
|
|
||||||
INSTALLATION *persistence.nvim-installation*
|
INSTALLATION *persistence.nvim-installation*
|
||||||
@ -69,7 +69,7 @@ Persistence comes with the following defaults:
|
|||||||
|
|
||||||
>lua
|
>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
|
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
|
options = { "buffers", "curdir", "tabpages", "winsize" }, -- sessionoptions used for saving
|
||||||
}
|
}
|
||||||
<
|
<
|
||||||
|
@ -27,19 +27,16 @@ function M.setup(opts)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M.start()
|
function M.start()
|
||||||
vim.cmd([[
|
vim.api.nvim_create_autocmd("VimLeavePre", {
|
||||||
augroup Persistence
|
group = vim.api.nvim_create_augroup("persistence", { clear = true }),
|
||||||
autocmd!
|
callback = function()
|
||||||
autocmd VimLeavePre * lua require("persistence").save()
|
M.save()
|
||||||
augroup end
|
end,
|
||||||
]])
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.stop()
|
function M.stop()
|
||||||
vim.cmd([[
|
pcall(vim.api.nvim_del_augroup_by_name, "persistence")
|
||||||
autocmd! Persistence
|
|
||||||
augroup! Persistence
|
|
||||||
]])
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.save()
|
function M.save()
|
||||||
|
Reference in New Issue
Block a user