Skip to content
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: add option on how to get a devicon #1133

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Futarimiti
Copy link

@Futarimiti Futarimiti commented Nov 2, 2023

Within the filetype component, Lualine always gets filetype devicon by file path, and fallback to using filetype only when unsuccessful. This design leads to problems when:

  1. Changing the filetype--the accompanying devicon will not be updated, if displayed Bug: filetype icon doesn't update when filetype is changed #537
  2. (More practically) Editing a file with an extension shared across multiple filetypes; a notable example is .pl which is used by both Prolog and Perl. Merely checking the file path (devicons.get_icon(vim.fn.expand('%:t'))) will always result in Perl's devicon regardless actual filetype

My proposal is to allow user decide how should the devicon be determined with option get_icon_by, with valid inputs 'filename' (traditional behaviour) or 'filetype' (prioritising get_icon_by_filetype over get_icon). I'm uncertain if this change should become the default behaviour; feel free to make it so if there's no strong reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant