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(icon): file & folder symlink icon (related to #910) #1119

Merged
merged 0 commits into from
May 15, 2024

Conversation

jackyhevey
Copy link

No description provided.

@jackyhevey jackyhevey marked this pull request as ready for review August 25, 2023 11:54
Copy link
Collaborator

@miversen33 miversen33 left a comment

Choose a reason for hiding this comment

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

Not really sure why the styling was changed on several of the functions but outside that very minor complain (which I assume gets fixed on merge by a bot), this looks good :)

@@ -200,6 +200,8 @@ local config = {
folder_open = "",
folder_empty = "󰉖",
folder_empty_open = "󰷏",
folder_symlink = "",
file_symlink = "",
Copy link
Contributor

Choose a reason for hiding this comment

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

This link is almost impossible for me to distinguish from the standard "unknown file" icon. Can we find one that's more obvious?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I'm not entirely sure I even want a default icon set for this. Some people might want to see the target's icon and not a generic symlink icon.

@@ -275,7 +275,11 @@ M.icon = function(config, node, state)
elseif node:is_expanded() then
icon = config.folder_open or "-"
Copy link
Contributor

Choose a reason for hiding this comment

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

I realize this problem pre-existed, but now I see that it doesn't make sense that there is only a symlink icon for closed dirs and not open ones. This should be fixed.

@@ -275,7 +275,11 @@ M.icon = function(config, node, state)
elseif node:is_expanded() then
icon = config.folder_open or "-"
else
icon = config.folder_closed or "+"
if node.is_link then
icon = config.folder_symlink
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
icon = config.folder_symlink
icon = config.folder_symlink or config.folder_closed or "+"

This needs fallbacks.

@@ -284,6 +288,9 @@ M.icon = function(config, node, state)
icon = devicon or icon
highlight = hl or highlight
end
if node.is_link then
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if node.is_link then
if node.is_link and config.file_symlink then

What if someone sets this to nil because they don't want to show a symlink icon?

@pysan3 pysan3 merged commit 25bfdbe into nvim-neo-tree:main May 15, 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.

4 participants