Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: load last cwd #63

Merged
merged 35 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3720e94
feat: add list_cwd command
josh-nz Jun 11, 2024
b446b65
feat: add cwd session support to telescope
josh-nz Jun 11, 2024
2671dc5
feat: load last session for cwd
josh-nz Jun 12, 2024
af1219f
fix: reduce calls to autosave_info
josh-nz Jun 12, 2024
17afbb9
fix: correct autosave log info
josh-nz Jun 12, 2024
7e697bc
fix: changes as per review
josh-nz Jun 13, 2024
0852a37
feat: add skip autosave opt, fixes startup autosave issues
josh-nz Jun 13, 2024
c7187d1
feat: add ListCwd command function to List command
josh-nz Jun 13, 2024
2d662fe
feat: show message when no session to autoload
josh-nz Jun 13, 2024
984b34a
feat: nicer error when loading session that does not exist
josh-nz Jun 13, 2024
aca4efa
fix: correct get_last typespec
josh-nz Jun 13, 2024
a93852a
fix: get_last caller to handle nil result
josh-nz Jun 13, 2024
d5e6255
fix: improve session action messages
josh-nz Jun 13, 2024
ba6eeed
Revert "feat: add ListCwd command function to List command"
josh-nz Jun 16, 2024
945a0f4
feat: add optional dir argument to PossessionListCwd command
josh-nz Jun 16, 2024
1a67b60
docs: correct PossessionLoad optional name description.
josh-nz Jun 16, 2024
8d373b6
feat: add optional dir argument to PossessionLoadCwd command
josh-nz Jun 17, 2024
97ce76f
docs: fixes spelling, more consistent in style.
josh-nz Jun 17, 2024
d715e76
chore: refactor to use absolute path function
josh-nz Jun 17, 2024
84c5748
feat: more autoload options
josh-nz Jun 17, 2024
f139ce3
feat: backwards compatibility with older autosave config
josh-nz Jun 17, 2024
6f9e0b1
fix: strip trailing slash from dir name
josh-nz Jun 17, 2024
056b1a7
fix: expand dir first otherwise dir check fails
josh-nz Jun 17, 2024
cd92d32
fix: run config compatibility before warning of unknown keys
josh-nz Jun 17, 2024
9b12c22
feat: smarter PossessionLoadCwd completion
josh-nz Jun 17, 2024
d9ab715
chore: refactor distinct list as query function
josh-nz Jun 19, 2024
08c9b7e
feat: add autoload config deprecation warning
josh-nz Jun 19, 2024
f9492cb
fix: use vim.deprecate for old autoload config setting
josh-nz Jun 22, 2024
1406a6a
fix: use improved unique session algorithm, adjust name
josh-nz Jun 22, 2024
57bddd8
feat: skip autoload when arguments are passed to Neovim
josh-nz Jun 23, 2024
50c875f
chore: fix spelling
josh-nz Jun 23, 2024
7db1fe6
feat: skip autoload if data is piped to Neovim
josh-nz Jun 25, 2024
bc2a5d9
feat: PossessionLoadCwd now takes a cwd session name
josh-nz Jun 25, 2024
3658c8a
docs: clarify the session name for PossessionSaveCwd
josh-nz Jun 25, 2024
5cc7ba6
fix: use last cwd session if no name passed to PossessionLoadCwd
josh-nz Jun 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/possession.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ autoload~
or a directory. If it is a directory, the last session for that directory
is loaded. The function can also return one of the above strings, in
which case the behaviour is as defined for that string.
If any files or folders are passed as command line arguments to Neovim,
autoload is always skipped.

*possession-hooks*
hooks.before_save~
Expand Down
5 changes: 5 additions & 0 deletions plugin/possession.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ vim.api.nvim_create_autocmd('VimEnter', {
vim.fn.delete(symlink)
end

if vim.fn.argc() > 0 then
-- Skip autoload if any files or folders are passed as command line arguments.
return
end

josh-nz marked this conversation as resolved.
Show resolved Hide resolved
local utils = require('possession.utils')
local al = utils.as_function(config.autoload)()
if al and al ~= '' then
Expand Down