gekoke / magit-file-icons

File icons for Magit
GNU General Public License v3.0
30 stars 6 forks source link

feat!: abstract icon getter functions #10

Open librephoenix opened 2 months ago

librephoenix commented 2 months ago

This PR abstracts the icon getter functions into two new variables: magit-file-icons-icon-for-file-func and magit-file-icons-icon-for-dir-func which will allow the package to support icon backends other than nerd-icons. These functions default to using nerd-icons functions for compatibility, but can be overriden with custom functions from any icon backend.

This removes the dependency on nerd-icons, which will break user config if they are using nerd-icons and have not called (require 'nerd-icons) before loading the package.

This also updates the documentation with an example (using all-the-icons) and updates the test files so tests can still run. The tests are only run using nerd-icons, however.

Hopefully this is an improvement over #5, so let me know what you think! Thanks!