Skip to content

Commit

Permalink
fix: handle autoload=true and display a warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jedrzejboczar committed Jan 23, 2025
1 parent fe2fe93 commit fff9368
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/possession.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ currently loaded session is used (unless noted otherwise).
Save the current session information under `session_dir`. Use
`:PossessionSave! [{name}]` to avoid asking for confirmation when overwriting
existing session file. If [{name}] is omitted and a session does not
already exist, you will be prompted for a name.
already exist, you will be prompted for a name.

*:PossessionLoad*
:PossessionLoad [{name}]~
Expand Down Expand Up @@ -156,7 +156,7 @@ autosave.on_quit~

*possession-autoload*
autoload~
`string | function(): string
`false | string | function(): string
Automatically load a session. Valid string values are:
- `last` loads the last saved session
- `auto_cwd` loads the session saved by `autosave.cwd` or `:PossessionSaveCwd`
Expand Down
3 changes: 3 additions & 0 deletions lua/possession/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ local function fix_compatibility(opts)
if type(autoload) == 'table' then
vim.deprecate('`setup.autoload.cwd = true`', '`autoload = "..."`', 'in the future', 'possession')
opts.autoload = autoload.cwd and 'auto_cwd' or false
elseif autoload == true then
vim.notify('`setup.autoload = true` is not valid, see `:help possession-autoload` for valid values', vim.log.levels.WARN)
opts.autoload = 'last'
end
end

Expand Down

0 comments on commit fff9368

Please sign in to comment.