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!
This PR abstracts the icon getter functions into two new variables:
magit-file-icons-icon-for-file-func
andmagit-file-icons-icon-for-dir-func
which will allow the package to support icon backends other thannerd-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!