-
Notifications
You must be signed in to change notification settings - Fork 9
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
Keep track of current project #30
base: main
Are you sure you want to change the base?
Conversation
Also changes the function to retrieve the name of the function from the file path itself.
… 'Project' instead
…stance - Convert switcher:switch() into being a wrapper function around switcher:switch_project() which constructs a Project instance internally - Fix 'workspace' not being created properly in Project:new_from_dir - Update switcher:set_current()to be safer - Reorder logic of switcher:switch() to improve safety and terseness
Sounds promising. Thank you for the PR. I will take a look at integrating this in a few days (am busy for a few days) 😄 One thing I noticed is - |
…f the Project class - Remove Project.new_from_dir() - Extract 'find workspace' logic into Workspace.find() - Add explicit function for detecting if we are in a project: Switcher:in_project() - Expand paths in Switcher:switch_project() so that comparisons provide consistent results
It is generated automatically from the README so doesn't need to be updated
Cheers for looking. I converted it to draft because I was having some trouble with some autocmds, turns out it was due to directory paths being inconsistent (darn Windows and its "\" separator). Also added a check within the switcher to make sure the project is a valid one by reusing the workspace logic found in Session. |
Apologies for being a bit late. But I will take a look at this today. 😄 |
As requested in #27
This brings in some changes which make
switcher
more responsible and keep track of the projects its opened. Some functionality is moved away fromsession
intoswitcher
.I know you want to keep
projections.nvim
very tiny which I appreciate, however I hope you will consider that this paves the way for potential future functionalities like:The implementation in this PR already allows some cool functionality, e.g. I am showing in my statusline that I'm inside a project:
Or not
And now a session is not overwritten when browsing a file within a workspace project that you didn't use
projections.switcher
to open!Let me know if you want anything tidying up, I was treating this as a proof of concept for the majority of the time so some things might be loosely named etc.