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

fix: properly start a session from Telescope #134

Merged
merged 2 commits into from
Jun 3, 2024

Conversation

oldenj
Copy link
Contributor

@oldenj oldenj commented May 31, 2024

Properly starts sessions loaded from another directory using Telescope. Crucially, this version compares the working directory of the session, not the working directory at the time of the session load, to the lists of allowed and ignored directories.

Properly starts sessions loaded from another directory using Telescope.
Crucially, this version compares the working directory of the session, not
the working directory at the time of the session load, to the lists
of allowed and ignored directories.
vim.g.persisting_session = config.options.follow_cwd and nil or session
utils.load_session(session, config.options.silent)
elseif type(config.options.on_autoload_no_session) == "function" then
config.options.on_autoload_no_session()
end
end

dir = session_dir()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This somewhat changes the logic.
If a user has follow_cwd = false, there might be a session file that is being loaded from directory A, but session_dir() after loading the session might return directory B.
In the case of opening via Telescope, I think it's clear that directory B should be tested against allow/ignore list.
The other case is not as clear.

@olimorris olimorris merged commit e50e0b6 into olimorris:main Jun 3, 2024
4 checks passed
@olimorris
Copy link
Owner

Amazing thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants