-
-
Notifications
You must be signed in to change notification settings - Fork 638
refactor(#2988): multi instance dir_up #3222
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
base: master
Are you sure you want to change the base?
Conversation
|
Thanks @Uanela I will get to a review on the weekend. What sort of task would you like to work on next? Another refactor? Bug? Feature? |
|
I guess a another refactor would help me still getting along with the codebase. |
Base Cases OKOpen
|
alex-courtis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good @Uanela , all tests pass and it's working beautifully.
Only one small change please:
|
|
||
| local newdir = vim.fn.fnamemodify(utils.path_remove_trailing(cwd), ":h") | ||
| require("nvim-tree.actions.root.change-dir").fn(newdir) | ||
| require("nvim-tree.actions.finders.find-file").fn(node.absolute_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move these requires up to the top of the file. Here's an example you can follow: https://github.com/nvim-tree/nvim-tree.lua/blob/master/lua/nvim-tree/actions/tree/open.lua#L3
Why do this at the start of the file?
- We only want to do it once, for speed
- Any problems with the require are found immediately at startup, instead of later at runtime
I'll get back to you shortly. The issue backlog needs to be groomed and tidied. |
Refactored the dir-up action by moving it from a standalone module into the Explorer class as a method. This improves code organization by consolidating explorer-related functionality within the Explorer class itself.
Changes