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: File Icons in File Picker #3878

Closed
wants to merge 1 commit into from

Conversation

jcdickinson
Copy link

@jcdickinson jcdickinson commented Sep 17, 2022

Introduces optional file icons for the FilePicker. The icons are accessed through the new FileInfo struct, which is a valid Item that includes the icon in its Span (if configured to do so).

The idea is that FileInfo could be used for additional file type metadata if it is needed in the future.

These icons assume the use of a nerd font, which is why they are disabled by default.

image

Introduces optional file icons for the `FilePicker`. The icons are
accessed through the new `FileInfo` struct, which is a valid `Item`
that includes the icon in its `Span` (if configured to do so).

The idea is that `FileInfo` could be used for additional file type
metadata if it is needed in the future.

These icons assume the use of a nerd font, which is why they are
disabled by default.

fn label(&self, data: &Self::Data) -> Spans {
let mut result = vec![Span::raw(format!(
" {}",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this isn't done then the icon overwrites the first character during render, and I'm not sure why. Any ideas?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that's a bug that should be solved by #3839

@the-mikedavis
Copy link
Member

There is prior open work on this: #2869. Also see the discussion in #2211

@kirawi kirawi added A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer. S-needs-discussion Status: Needs discussion or design. labels Sep 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements S-needs-discussion Status: Needs discussion or design. S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants