-
-
Notifications
You must be signed in to change notification settings - Fork 610
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
Improve git icons on directories #1809
Conversation
I think we can remove that. The order of statuses to icons retrieved by |
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.
I've tested a variety of cases, however it's not practical to test all cases.
Please:
- use natural order for statuses: Improve git icons on directories #1809 (comment)
-
common.lua
->node.lua
(optional) - use
git_statuses
git_status
consistently in all ofnode.lua
- merge master and retest: feat(view): add filters.git_clean, filters.no_buffer #1784 introduced some changes to git statuses. I've added you to this repo so that you can create branches in here in the future.
Thank you so much: this refactor and consolidation is a great improvement to the codebase.
@@ -48,7 +45,7 @@ function M.reload_explorer() | |||
end | |||
|
|||
function M.reload_git() | |||
if not core.get_explorer() or not git.config.enable or event_running then | |||
if not core.get_explorer() or not git.config.git.enable or event_running then |
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.
good catch
and show all children's status on parent
Tested update_git_status in reloaders.lua
Hmmm are you sure? Imo it looks quite weird having folders with the same combination of status being different, for example: Here both marks and renderer have some files changed and some new files, but it looks like they have different git status. Though tbh even with their icons sorted they'd still have different highlight. Maybe what we need is to sort the statuses? |
Whoops... I didn't notice that it was a maplike table. Options:
I like 1. |
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 undo my bad idea: #1809 (comment)
@@ -60,19 +60,19 @@ local function warn_status(git_status) | |||
end | |||
|
|||
local function get_icons_(node) | |||
local git_statuses = explorer_common.get_git_status(node) | |||
if git_statuses == nil then | |||
local git_status = explorer_common.get_git_status(node) |
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.
I was actually thinking we could use git_statuses
everwhere as it is a much better variable name, similar to iconss
.
However... looking through the whole codebase we are using git_status
everywhere so I guess that change is outside of the scope of this PR.
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.
Ahhh sorry, I misunderstood. Perhaps I'll open a PR right after this one specifically for git_statuses?
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.
If you're keen I would be most grateful! There are a lot of usages...
This reverts commit 23f6276.
Many thanks for your contribution |
After adding option git.show_on_open_dirs, I've discovered some undesirable behavior:
This PR fixes the above two short coming and also made parent directories show all the git status icons from their children.
The ordering of the git icons in
lua/nvim-tree/renderer/components/git.lua:10
are made to preserve the original ordering of some of the multi-icons status. I'd be happy to change it if anyone have different preferences :).