Skip to content

Commit 4376507

Browse files
committed
Require neovim 0.10
1 parent a0b9d25 commit 4376507

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ local config = require('session_manager.config')
3535
require('session_manager').setup({
3636
sessions_dir = Path:new(vim.fn.stdpath('data'), 'sessions'), -- The directory where the session files will be saved.
3737
session_filename_to_dir = session_filename_to_dir, -- Function that replaces symbols into separators and colons to transform filename into a session directory.
38-
dir_to_session_filename = dir_to_session_filename, -- Function that replaces separators and colons into special symbols to transform session directory into a filename. Should use `vim.loop.cwd()` if the passed `dir` is `nil`.
38+
dir_to_session_filename = dir_to_session_filename, -- Function that replaces separators and colons into special symbols to transform session directory into a filename. Should use `vim.uv.cwd()` if the passed `dir` is `nil`.
3939
autoload_mode = config.AutoloadMode.LastSession, -- Define what to do when Neovim is started without arguments. Possible values: Disabled, CurrentDir, LastSession
4040
autosave_last_session = true, -- Automatically save last session on exit and on session switch.
4141
autosave_ignore_not_normal = true, -- Plugin will not save a session when no buffers are opened, or all of them aren't writable or listed.

lua/session_manager/init.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ end
5151

5252
--- Loads a session for the current working directory.
5353
function session_manager.load_current_dir_session(discard_current)
54-
local cwd = vim.loop.cwd()
54+
local cwd = vim.uv.cwd()
5555
if cwd then
5656
local session = config.dir_to_session_filename(cwd)
5757
if session:exists() then
@@ -62,7 +62,7 @@ end
6262

6363
--- Saves a session for the current working directory.
6464
function session_manager.save_current_session()
65-
local cwd = vim.loop.cwd()
65+
local cwd = vim.uv.cwd()
6666
if cwd then
6767
utils.save_session(config.dir_to_session_filename(cwd).filename)
6868
end
@@ -94,7 +94,7 @@ end
9494

9595
--- Deletes the session for the current working directory.
9696
function session_manager.delete_current_dir_session()
97-
local cwd = vim.loop.cwd()
97+
local cwd = vim.uv.cwd()
9898
if cwd then
9999
local session = config.dir_to_session_filename(cwd)
100100
if session:exists() then

lua/session_manager/utils.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ end
9393
---@param filename string
9494
function utils.delete_session(filename)
9595
Path:new(filename):rm()
96-
local cwd = vim.loop.cwd()
96+
local cwd = vim.uv.cwd()
9797
if utils.is_session and cwd and filename == config.dir_to_session_filename(cwd).filename then
9898
utils.is_session = false
9999
end
@@ -115,7 +115,7 @@ function utils.get_sessions(opts)
115115

116116
-- If we are in a session already, don't list the current session.
117117
if utils.is_session then
118-
local cwd = vim.loop.cwd()
118+
local cwd = vim.uv.cwd()
119119
local is_current_session = cwd and config.dir_to_session_filename(cwd).filename == sessions[1].filename
120120
if is_current_session then
121121
table.remove(sessions, 1)
@@ -173,7 +173,7 @@ end
173173

174174
---@return boolean
175175
function utils.is_dir_in_ignore_list()
176-
local cwd = vim.loop.cwd()
176+
local cwd = vim.uv.cwd()
177177
-- Use `fnamemodify` to allow paths like `~/.config`.
178178
return vim.tbl_contains(config.autosave_ignore_dirs, cwd) or vim.tbl_contains(config.autosave_ignore_dirs, vim.fn.fnamemodify(cwd, ':~'))
179179
end

plugin/session_manager.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
if not vim.fn.has('nvim-0.7.0') then
2-
require('session_manager.utils').notify('Neovim 0.7+ is required for session manager plugin', vim.log.levels.ERROR)
1+
if not vim.fn.has('nvim-0.10.0') then
2+
require('session_manager.utils').notify('Neovim 0.10+ is required for session manager plugin', vim.log.levels.ERROR)
33
return
44
end
55

0 commit comments

Comments
 (0)