Skip to content

Commit fcc6e00

Browse files
Merge pull request #45 from gennaro-tedesco/dir_check
added dir check before listing session files
2 parents 0844f6d + b10920c commit fcc6e00

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lua/nvim-possession/utils.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ local M = {}
44
---@param file string
55
---@return table
66
M.session_files = function(file)
7+
if vim.fn.isdirectory(file) == 1 then
8+
return {}
9+
end
710
local lines = {}
811
local cwd, cwd_pat = "", "^cd%s*"
912
local buf_pat = "^badd%s*%+%d+%s*"

0 commit comments

Comments
 (0)