Skip to content

Commit

Permalink
docs: correct PossessionLoad optional name description.
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-nz committed Jun 16, 2024
1 parent 10f8409 commit f6203b2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/possession.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ already exist, you will be prompted for a name.
*:PossessionLoad*
:PossessionLoad [{name}]~

Load given session from disk. When `name` is not ommitted, then use last
Load given session from disk. When `name` is ommitted, then use last
loaded session name.

*:PossessionSaveCwd*
Expand Down
12 changes: 9 additions & 3 deletions lua/possession/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,19 @@ local function get_session_names()
end

M.complete_session = complete_list(function()
return vim.tbl_map(function(s) return s.name end, get_session_names())
return vim.tbl_map(function(s)
return s.name
end, get_session_names())
end)

M.cwd_complete_session = complete_list(function()
local cwd = vim.fn.getcwd()
local cwd_sessions = vim.tbl_filter(function(s) return s.cwd == cwd end, get_session_names())
return vim.tbl_map(function(s) return s.name end, cwd_sessions)
local cwd_sessions = vim.tbl_filter(function(s)
return s.cwd == cwd
end, get_session_names())
return vim.tbl_map(function(s)
return s.name
end, cwd_sessions)
end)

local function get_current()
Expand Down

0 comments on commit f6203b2

Please sign in to comment.