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

It's hard to find the wanted file type in the list #24

Open
Tofee opened this issue Oct 22, 2023 · 1 comment
Open

It's hard to find the wanted file type in the list #24

Tofee opened this issue Oct 22, 2023 · 1 comment

Comments

@Tofee
Copy link

Tofee commented Oct 22, 2023

When I do a paste, and want to select the file type, the ordering of the list is not intuitive: the first 10 entries or so are a mystery to me, then the rest looks like it's sorted by the extension, but that extension is never shown.

So we end up looking for a bash highlighting near the "B", but no, it's near the "S" words, between SCSS and... "Highlight non-printable".

I would suggest to either:

  • show the extension first, so that the sorting is obvious
  • provide a search field (there is already a space between "Paste" and the list, maybe it could fit there?)
  • if only the alias is shown, actually sort by the alias string (so Bourne would be in the Bs)

Also, not related but nice-to-have, applying the selected highlight to the current text would be, well, nice.

@Tofee
Copy link
Author

Tofee commented Oct 22, 2023

Looking at some solutions out there, I found this nice snippet:

https://github.com/madeindjs/select_option_filters/blob/master/selectOptionFilter.js#L1-L33

Which can be used here by calling add_filter('ext')
I tried it, and by adding near the end of the function a simple option.hidden = option.disabled; we get a nice working filter:

Maybe I can even try and PR something, though I'm not sure how to do the CSS part.

Tofee added a commit to Tofee/wantguns-bin that referenced this issue Oct 22, 2023
Dynamically filter the content of the hightlight options. The filter
can be a regexp, and is case insensitive.

Fix for wantguns#24

Signed-off-by: Christophe Chapuis <[email protected]>
PatrickHaussmann pushed a commit to PatrickHaussmann/paste that referenced this issue Mar 1, 2024
Dynamically filter the content of the hightlight options. The filter
can be a regexp, and is case insensitive.

Fix for wantguns#24

Signed-off-by: Christophe Chapuis <[email protected]>
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

No branches or pull requests

1 participant