lf icon indicating copy to clipboard operation
lf copied to clipboard

Case insensitive extension matching for icons & colors

Open desbma opened this issue 1 year ago • 2 comments

This changes the extension matching algorithm for icons & color selection to force lowercase search, effectively making it case insensitive.

I noticed that the icons & coloring where different for .jpg and .JPG files. For the icons I can generate a new ~/.config/lf/icons file with all extensions lowercase and uppercase but that is not ideal since it does not cover mixed case for example Jpg extension. For colors I use vivid to generate the LS_COLORS environement varibale, wich only generates lowercase extensions.

This change makes lf behavior in line with other programs I checked (I suspect they are many more):

  • GNU ls handling of LS_COLORS
  • lsd handling of LS_COLORS and icons
  • vivid

desbma avatar Aug 13 '22 12:08 desbma

There is #805 already which does it only for icons.

lahwaacz avatar Aug 20 '22 08:08 lahwaacz

That's right, sorry I missed that. I'm keeping this PR open though, because it makes sense to do the same for colors.

desbma avatar Aug 20 '22 18:08 desbma

@desbma Sorry for late reply and thanks for the patch.

gokcehan avatar Oct 01 '22 13:10 gokcehan