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

feat(set_root): allow filesystem and buffers to run set_root when the cursor is on both files and directories #1420

Merged
merged 6 commits into from Apr 6, 2024

Conversation

xvzc
Copy link
Contributor

@xvzc xvzc commented Mar 30, 2024

This Pull Request adds features that has been mentioned in #1419, and enhances the functionality of set_root for Neotree buffers and Neotree filesystem.

@pysan3
Copy link
Collaborator

pysan3 commented Mar 31, 2024

@xvzc Sorry for many requests.

tree:get_node() as well as get_parent_id() may return nil so could you check and bail out when that's the case?

(Cursor is on a line with no nodes, cursor is on the root node)

A very simple if not xxx then return end is enough.
You'll need to add 6 lines each but that's ok.

Thank you ;)

@xvzc
Copy link
Contributor Author

xvzc commented Mar 31, 2024

No problem. Thank you for your instruction :)

@pysan3
Copy link
Collaborator

pysan3 commented Mar 31, 2024

My bad, you'll need to if not node return before local id because <nil>.type will error out.

6 lines = 3 for not node and 3 for not id.

@pysan3
Copy link
Collaborator

pysan3 commented Mar 31, 2024

Thanks! LGTM.

@cseickel cseickel merged commit 6604275 into nvim-neo-tree:main Apr 6, 2024
2 checks passed
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.

None yet

3 participants