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

get icons based on file paths rather than display text #955

Open
2 tasks done
jason0x43 opened this issue Jun 10, 2024 · 2 comments
Open
2 tasks done

get icons based on file paths rather than display text #955

jason0x43 opened this issue Jun 10, 2024 · 2 comments
Labels

Comments

@jason0x43
Copy link

Contributing guidelines

Module(s)

mini.pick

Description

I made a custom source to show git files with multiple scopes, along with the status, based on this comment. The items look like

{
  text = "H path/to/file.js",
  path = "path/to/file.js"
},
{
  text = "? path/to/untracked.js",
  path = "path/to/untracked.js"
},

That works great, except that file icons don't show up. The request is for default_show to show icons for file items based on the file path rather than the display text.

The root issue is that get_icon in default_show is passed the text of each item rather than the entire item (or the path for file items).

@jason0x43 jason0x43 added the feature-request Feature request label Jun 10, 2024
@jason0x43
Copy link
Author

jason0x43 commented Jun 10, 2024

A way to specify a custom prefix in the item would also work, assuming the icon would be added onto that. Maybe. Something like

{
  text = "path/to/file.js",
  prefix = "H",
  path = "path/to/file.js"
}

@echasnovski
Copy link
Owner

Thanks for the suggestion!

This looks like a reasonable use case. There is some work planned regarding icons in 'mini.nvim', so I think I'll revisit this feature during it.

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

No branches or pull requests

2 participants