-
Notifications
You must be signed in to change notification settings - Fork 225
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
Conversation
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.
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 :)
lua/neo-tree/defaults.lua
Outdated
@@ -200,6 +200,8 @@ local config = { | |||
folder_open = "", | |||
folder_empty = "", | |||
folder_empty_open = "", | |||
folder_symlink = "", | |||
file_symlink = "", |
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.
This link is almost impossible for me to distinguish from the standard "unknown file" icon. Can we find one that's more obvious?
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.
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 "-" |
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 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 |
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.
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 |
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 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?
No description provided.