Skip to content

feat(renderer): allow placing git icons after filename #1203

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

Merged
merged 5 commits into from
May 7, 2022

Conversation

kyazdani42
Copy link
Member

@kyazdani42 kyazdani42 commented Apr 26, 2022

This is a first draft, i'd like to improve the code a bit before merging because it's not pretty as it is, but usable.
This also change the behavior for special icons, which will display icons normally instead of the default file icon.

TODO:

  • config option documentation
  • improve the algorithms for placing the git icon
  • add the git icon for the symlinks also

implements #246, #1069 and #72, #1217

@gegoune
Copy link
Collaborator

gegoune commented Apr 26, 2022

Screenshot 2022-04-27 at 00 55 33

Will check if master is the same but seeing some odd highlighting on that PR.

that was with:

vim.g.nvim_tree_icons = {
  git = {
    unstaged = 'M',

Adding more chars, like:

vim.g.nvim_tree_icons = {
  git = {
    unstaged = '[M]',

shifts highlight even more:
Screenshot 2022-04-27 at 00 58 24

@kyazdani42
Copy link
Member Author

i guess, see my comment before :) this is not perfect yet, the algorithms are very clunky as it is.

@gegoune
Copy link
Collaborator

gegoune commented Apr 26, 2022

Wasn't complaining, just reporting, PR is in progress, of course. :)

@kyazdani42 kyazdani42 force-pushed the feat/allow-placing-git-icons-after-fname branch from 6bd0637 to 4379ea1 Compare April 27, 2022 19:47
@kyazdani42 kyazdani42 requested a review from alex-courtis April 27, 2022 20:16
@kyazdani42
Copy link
Member Author

@gegoune could you give it another try ? i've fixed multiple issues and also added icons for symlinks :)

@gegoune
Copy link
Collaborator

gegoune commented Apr 27, 2022

@gegoune could you give it another try ? i've fixed multiple issues and also added icons for symlinks :)

Highlighting issue seems to be fixed now.

Unrelated, and I think there already is an issue for it, but why not put those markers in signcolumn?

@alex-courtis
Copy link
Member

Nice. I'll give this a test / review on the weekend.

@kyazdani42
Copy link
Member Author

the signcolumn is another issue, i'll implement this after :) one thing at a time !

Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definitely works. Tested files and folders: before, after, foo

@alex-courtis
Copy link
Member

alex-courtis commented Apr 30, 2022

RE symlink git icons:

They are not really part of this change. They can be made to work with some tweaking of node-builders.link, conditionally using the absolute or link path and get_dir_git_status for folder links.

Raised #1217. I've pushed a WIP branch that I'll get back to later.

@kyazdani42
Copy link
Member Author

@alex-courtis do you want me to remove the code that adds the git icons for symlinks ? It works fine on my end though.

@kyazdani42 kyazdani42 force-pushed the feat/allow-placing-git-icons-after-fname branch from 6d13b8f to 5d25057 Compare April 30, 2022 13:03
@alex-courtis
Copy link
Member

@alex-courtis do you want me to remove the code that adds the git icons for symlinks ? It works fine on my end though.

No! I've tested it. Once we resolve #1217 everything will display correctly.

@kyazdani42 kyazdani42 force-pushed the feat/allow-placing-git-icons-after-fname branch 2 times, most recently from 2f250c9 to f2aba7f Compare May 7, 2022 10:01
kyazdani42 added 5 commits May 7, 2022 12:17
- fix last issues with git placement highlighting
- create a formatting function for simplifying code
- add git icon in symlink
@kyazdani42 kyazdani42 force-pushed the feat/allow-placing-git-icons-after-fname branch from f2aba7f to 206ee78 Compare May 7, 2022 12:05
@kyazdani42 kyazdani42 merged commit a1600e5 into master May 7, 2022
@kyazdani42 kyazdani42 deleted the feat/allow-placing-git-icons-after-fname branch May 7, 2022 12:05
Almo7aya pushed a commit to Almo7aya/nvim-tree.lua that referenced this pull request Oct 11, 2022
This feature allows placing git icons after the filename.
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.

3 participants