wantguns / bin

highly opinionated, minimal pastebin
https://basedbin.fly.dev
GNU Lesser General Public License v3.0
194 stars 20 forks source link

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

Open Tofee opened 8 months ago

Tofee commented 8 months ago

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:

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

Tofee commented 8 months ago

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.