-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update logic for autoload or starting sessions (#104)
* Update logic for autoload or starting sessions. The logic to prevent autoloading/starting sessions when any arguments are supplied to neovim is to prevent session management from kicking in when editing a single file. This updates the logic to allow a single argument passed to neovim as long as the argument is an existing directory. When neovim is launched in this way it behaves the same as opening neovim with no arguments but has changed the working directory. This results in consistent behavior of the autoloading/starting of sessions when passing a directory argument to start neovim. See: #93 * Fix comment, make comparisons more direct * Update functions to be directory-aware The main functionality in `init.lua` assumes using current working directory in most cases. This refactors these functions to allow passing in a directory instead. The default behavior is to now use the current directory unless neovim was started with a single directory argument, using that instead. This also special-cases `.` as `vim.fn.expand()` does not resolve that to the current working directory.
- Loading branch information
Showing
3 changed files
with
79 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters