-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
xplr.util.lscolor returns nil for normal files #705
Comments
Thanks for reporting this with detailed explanation. The function lscolor() documentation actually says it can return I'll change the function return type from |
Closes: #705 Also update xplr version.
Closes: #705 Also update xplr version.
Closes: #705 Also update xplr version.
Closes: #705 Also update xplr version.
Ah, I must have missed that when reading the documentation. Thanks anyway for the quick fix, this way the default implementation of |
xplr.util.lscolor
returnsnil
for a normal file (non-executable, not a symlink, and so on), which causes issues forxplr.util.style_mix
.Minimal example configuration:
The config works correctly for directories:
It also works fine for any file with a non-default styling by LS_COLORS, for e.g. executable files:
It does not work for files with empty styling:
The issue seems to be that for files with empty styling,
xplr.util.lscolor
returns nil. A possible fix is to modify the rendering function:Then styling works correctly:
I think the actual fix lies elsewhere though. I'm not yet familiar enough with Rust to open a PR, but there seems to be a bug in
util::lscolor
in the line below:xplr/src/lua/util.rs
Line 667 in c1bb251
LsColors::style_for_path
returns anOption
so there needs to be a check forNone
. Or alternativelyStyle::from
needs to perform a check forNone
.The text was updated successfully, but these errors were encountered: