-
Notifications
You must be signed in to change notification settings - Fork 272
feat: file nesting #164
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: file nesting #164
Conversation
|
Thanks for working on this! I tried it out and it works for some files, but not all. It seems like a pattern matching issue. Given this config: nesting_rules = {
["ts"] = {"d.ts", "js", "spec.ts", "html", "css", "scss" }
},..this will work: but this won't:
I think this is an interesting enough feature to highlight on the README.
I think the extension logic is probably the right way to go, keeps it simple.
I would expect it to behave like a folder. Personally, I would also want them to be collapsed by default. We might need to replace some |
I thought it, but what if you want to open the file itself?, also I should add a component that tells you if the file have a nesting files
and yes, I think the problem is here, I'll look for all naming cases to add to the pattern |
|
FWIW, the default UI I'd expect would collapse these "dirs", but add a |
|
Sounds legit. I can imagine the specifics could be customizable as well |
|
Hi, sorry inactivity, then should I set a custom icon(instead of the file icon itself) if file is file has nesting files? |
sounds like there should be a new icon column to the left of the existing icon, which (for now) holds the disclosure widget ( |
Yes, I think that's the way. When file nesting is enabled, the folder icon should look like a folder instead of the simple triangle, and anything that |
|
Sounds good |
|
I think we can just fix the markers so that they extend the extra space when they need to. I'm happy to work on that separately if you want to submit this as is. |
|
I'll try to fix it first, thanks |
|
@cseickel I had to put the arrows into the indent component, so is fine if the arrows uses the same highlight group as the indent markers or should have a specific highlight group(might be a breaking change because it will need to change the |
|
I'm not crazy about having the indent component doing so many different things, but I do like the way that looks. I think in the future I might try to find a way to configure overlapping components to handle things like the indent / guides / nesting component. Definitely a problem for another day though... For now, I think you can go ahead and add the two new highlight groups, but also keep the existing highlight group which can serve as the default for both. local marker_highlight = config.marker_highlight or config.highlight
local arrow_highlight = config.arrow_highlight or config.highlightThat way there's no breaking change. |
|
Oh, yeah |
|
I gave it a quick try and it works well. One thing I would change is that it didn't feel intuitive to have to turn on the Also, on the same topic, I think I prefer the term All in all, this looks really awesome! |
|
really jazzed to try this out |
Thanks!
Something like this? require("neo-tree").setup({
expander = {
enabled = true, -- if nil and file nesting is enabled, will set to true
expanded = "", -- expanded icon
collapsed = "", -- collapsed icon
highlight = "NeoTreeExpander",
}
})(still all the logic will be into the indent marker component) |
I was originally just thinking of replacing the word "arrow" with "expander" in the indent component config: with_arrows = true,
arrow_collapsed = "",
arrow_expanded = "",changed to: with_expanders = true,
expander_collapsed = "",
expander_expanded = "",...but having a completely different section is probably cleaner. That entire section can just be copied right onto the indent components config during setup. I'm just not sure if the name "expander" is obvious enough in that context. Maybe "expander_icons" or "expander_controls"? @bennypowers do you have any thoughts on this? |
|
I have an idea, it's a bit complex(I think) but is making the |
YES! |
|
@cseickel check it again please(check |
|
@lopi-py You did a nice job with the extensions class, but I thought of another way last night as I was falling asleep that I'd like to discuss. This affects more than just this feature so I am going to post to the discussions and I'll @mention you when I do. |
|
wrt naming, i don't mind "expander". another name for the top level config key that i think makes sense is "nesting" |
|
Hey @lopi-py , sorry for all the back and forth on how to configure this. I think that the whole concept of how to handle these overlapping elements is a bigger discussion that we should take our time with, and not hold up this feature. For now, can we just go back to the simple case of adding this config to the indent = {
indent_size = 2,
padding = 1,
-- indent guides
with_markers = false,
indent_marker = "│",
last_indent_marker = "└",
highlight = "NeoTreeIndentMarker",
-- expander config, needed for nesting files
with_expanders = true,
expander_collapsed = "",
expander_expanded = "",
expander_highlight = "NeoTreeExpander"
},We can refactor later once discussion #191 has had some time to hopefully gather input from more people. |
|
@cseickel This can be merged I guess |
|
Looks good, thanks! |





closes #118
