Closed ghostbuster91 closed 1 year ago
The only difference I can see here is how the directory structure is displayed on the file source vs the git and buffer source. Am I missing something?
Sorry, my description was incomplete.
Here is a list of differences:
use_git_status_colors
was disabled entries in buffer and git sources have the color appliedThat makes sense, thanks for clarifying!
1) This is almost certainly intentional. As a file browser, the user may want to modify any of the in between directories on tree and as such, they should all be exposed as their own nodes (IE uncompressed). I don't know what setting would need to be modified for this, but IMO it should not be changed as it makes sense within the context of a "File Browser"
2) Totally missed that. That's strange, I would imagine use_git_status_colors
would do exactly what its name implies. I'll take a peek this afternoon and see if I can figure out why this didn't work "as expected", though I may come back with π€·ββοΈ, I am not that familiar with the codebase.
3) Ya I am not super fond of this, IMO icons should all line up the same regardless of source. My best off the cuff guess is that the git
source is using or overriding different components to display its nodes. I'll poke that a bit as well and see what I can find out.
@miversen33 Just to add my insights as I've been digging around in the components part. Regarding 2, git_status
and buffers
override the name
component, so I think that's what causes this. For 3, I think it is because some calculation with the padding, which could also stems from this override.
@nhat-vo
Regarding 2, git_status and buffers override the name component, so I think that's what causes this.
Is this how it should be? I couldn't find any settings for that in https://github.com/nvim-neo-tree/neo-tree.nvim/blob/v2.x/lua/neo-tree/defaults.lua I think that it is confusing that users are supposed to configure default_component_configs
when in the end these values are not used.
@miversen33
This is almost certainly intentional. As a file browser, the user may want to modify any of the in between directories on tree and as such, they should all be exposed as their own nodes (IE uncompressed). I don't know what setting would need to be modified for this, but IMO it should not be changed as it makes sense within the context of a "File Browser"
Right, this makes sense. There is filesystem.group_empty_dirs
options which does that. And for the buffer
source there is indeed no reason not to group directories. However, it seems that group_empty_dirs
could be also exposed for the git
source, wdyt?
However, it seems that group_empty_dirs could be also exposed for the git source, wdyt?
I did not even realize the git source was not grouping them lol. I don't personally see an issue with adding that configuration option though I don't know the amount of work that would go into respecting it. That is likely more an @nhat-vo or @cseickel question. I don't have alot of experience in making modifications to the codebase, more so troubleshooting stuff :)
Anyway! So onto the item I said I would look into.
Taking a peek at #421, it looks like this option should go under default_component_configs.name
EG
default_component_configs = {
name = {
use_git_status_color = false
}
}
I can confirm that setting this here removes the git config
With the setting disabled
And with the setting enabled
I will take a look at the third point later tonight, I haven't spent much time looking at the git source
@miversen33 I agree that configuring use_git_status_color
like that works for the filesystem source. My problem is that it doesn't work for the other sources. Unless what you showed is the git source, then I am confused why it doesn't work for me.
Here is my configuration https://github.com/ghostbuster91/dot-files/blob/neotree/programs/neovim/config/lua/local/neotree.lua#L45
Sorry for the ambiguity π .
Regarding 2, git_status and buffers override the name component, so I think that's what causes this.
What I meant here was that currently, git_status
and buffers
sources are overriding the default name
component, and they do not take into account the use_git_status_colors
config. Just pushed #864 to fix this. Feel free to have look to see if it fixes your problem. (Side note: it is currently a PR, so you can check it out by using
-- 'nvim-neo-tree/neo-tree.nvim' -- change this
{'nhat-vo/neo-tree.nvim', branch = '859-components'}, -- with this
kudos to @miversen33π)
Regarding point 3, I'm planning to refactor the padding logic to avoid these kinds of missing/redundant padding behavior. This is a bit more complicated, so I'll add this to the PR later.
Regarding point 1, #832 and #833 also refers to this config, so I think it's best to have someone work on these 3 later.
No worries. That is all actually clear, my answer was regarding the screenshot from @miversen33.
Regarding point 3....
Awesome π
Regarding point 1, #832 and #833
Yeah, I also saw them because I wanted to report the same things π
Thank you both for explaining all of that to me and working on that. Much appreciated π
@miversen33 I agree that configuring
use_git_status_color
like that works for the filesystem source. My problem is that it doesn't work for the other sources. Unless what you showed is the git source, then I am confused why it doesn't work for me.Here is my configuration https://github.com/ghostbuster91/dot-files/blob/neotree/programs/neovim/config/lua/local/neotree.lua#L45
Ahh my bad I didn't check the git source when I did my test. It sounds like @nhat-vo is addressing that though, good catch both of you :)
I am going to close it. The main issue about inconsistency between views has been fixed by #864 .
My point about exposing group_empy_dirs
for git source is in general valid but after some consideration I decided that I like the current way of displaying things more.
First of all, thanks for this great plugin. I really think that it makes a lot of sense to have such generic view for tree-like data structures. I have plenty of ideas what to integrate next but first I need to get familiar with the basics, hence my migration from nvim-tree.
I modified
file
anddirectory
renderers slightly to my liking but I noticed that my modifications look inconsistent across different sources.File source:
Buffer source:
Git source:
Code for renderes:
I also have a
name
component modified:neotree rev: 205184aa0e0f08e8a1249d9bb37b45bae85f01b9