Page 1 of 3

Search fields - Auto wildcarded regex

Posted: 26 Feb 2017 19:09
by highend
Hard to describe this...

Let's say we're using inputselect() to show a list of folders and we want to select a specific one
of the results by typing into the provided searchbox (with the least minimal strokes). Notice
that this list is only hypothetical.

Code: Select all

C:\Users\Highend\AppData\Microsoft\Windows\Programs
C:\Users\Highend\AppData\Microsoft\Windows\Programs\StartUp
C:\Users\Highend\AppData\Roaming\Microsoft\Windows\Programs
C:\Users\Highend\AppData\Roaming\Microsoft\Windows\Programs\StartUp
The goal is to select the last entry
You could use "roa" (for "Roaming")
to get only the last two ones
or "up"
to get the second and the fourth

And sure, you could use the cursor keys afterwards but imagine that list
contains dozens or hundreds of (partly similar) entries.

What I whish?

Either a tweak (preferred) that puts all search fields (e.g. Configuration - Jump to... has one as well)
into a special regex mode or as an alternative, a prefix (e.g. ":" but should probably be tweakable)
that works like this
^.*<char 1>.*<char 2>.* ... .*<char x>.*$
While the number of typed chars can range from one to ~...

This allows to just type (tweak version):
roaup
which matches only the last entry

You may say: Who needs this?
Me^^

And probably everybody else who wants to narrow down (larger) lists while typing
only the minimum characters needed.

I'm trying to get rid of the tree completely and my favorites script lists all (sub-) folders
in specific locations but narrowing this list is a bit cumbersome without this feature...

E.g. ReSharper (from JetBrains) extends Visual Studio IntelliSense in the same way, which
makes typing + selecting methods, properties, etc. a really pleasant experience
intellisense.png
intellisense.png (20.36 KiB) Viewed 2497 times
Try this once and you'll never want to use something else (I'm not talking about VS / ReSharper) :)

Re: Search fields - Auto wildcarded regex

Posted: 27 Feb 2017 06:25
by highend
Another post where the potential of this addition would come through:
viewtopic.php?f=5&t=17105&p=146893#p146893

Search field = Live Filter Box

Re: Search fields - Auto wildcarded regex

Posted: 27 Feb 2017 06:44
by Filehero
+1

Re: Search fields - Auto wildcarded regex

Posted: 27 Nov 2018 09:42
by admin
Okay, but why RegExp? Isn't it just this?:

Typed pattern: abc
Auto-converted to: *a*b*c*

Re: Search fields - Auto wildcarded regex

Posted: 27 Nov 2018 09:52
by highend
Regex would allow more sophisticated features like using positive / negative lookaheads (even in this context).
But for a basic "fire-and-forget" solution *-autoembracing would work as well

Re: Search fields - Auto wildcarded regex

Posted: 27 Nov 2018 11:06
by admin
So, in which places would you like to see this?

Re: Search fields - Auto wildcarded regex

Posted: 27 Nov 2018 16:07
by highend
If possible in all (live) filter boxes^^

E.g.:
Tools - List Management - <all menu entries>
They all use the same interface and same live filter box

-> Help - List All Commands...
-> Tools - Configuration - Jump to Setting...

-> Scripting - inputselect()

Even the normal live filter box for panes would profit from this behavior.

The default value should be "off" and it would be better if this can be switched
on/off in the config dialog instead of only a tweak and a necessary restart

Re: Search fields - Auto wildcarded regex

Posted: 27 Nov 2018 16:13
by admin
Needs some thinking. Codename shotgun...

Re: Search fields - Auto wildcarded regex

Posted: 27 Nov 2018 19:54
by highend
I've reread my own first posting and think that using a special operator as an additional option would be a nice addition.

So:
- Still a config option in the GUI if auto-wildcard-embracing is on or off (off by default)
and
- Using a prefixed special operator (probably a char that isn't allowed in file / foldernames like ">" (as it is used to switch the normal search into regex mode)). Really cool would be, if we could tweak that special operator to whatever we want (I for myself would probably use the "." (dot) instead of ">")

So that even if the GUI option is off you can use the special operator to turn it (temporarily) on for the current live filter box
When the GUI option is already on, the special operator is just ignored

Best of both worlds and usable even without turning it on for all for all LFBs...

Re: Search fields - Auto wildcarded regex

Posted: 27 Nov 2018 20:07
by admin
I'd prefer a customizable prefixed special operator for starters.

Re: Search fields - Auto wildcarded regex

Posted: 27 Nov 2018 20:11
by highend
I've probably changed the wording of my last post while you were reading it. Please read it again

Re: Search fields - Auto wildcarded regex

Posted: 28 Nov 2018 19:51
by admin
I added it as a tweak, but I it does work as good as I expected. I find it hard to filter what I want using this method. Try yourself...

Re: Search fields - Auto wildcarded regex

Posted: 28 Nov 2018 20:20
by highend
I like it but I'm used to such kind of behavior. If you use it frequently your brain is building mnemonics for
items that require either a lot of typing or (with less typing) leave a lot of items to choose from.

Thanks for implementing it!

Re: Search fields - Auto wildcarded regex

Posted: 28 Nov 2018 21:11
by Leito
Definitely interesting...

I'm used to this as well via VS Intellisense (no need for Resharper to have this behavior btw) and it is definitely a nice addition.

Which characters are supported for the tweak pattern? I've tried to use ">" but it doesn't work.
Nevermind, I'm dumb.

Re: Search fields - Auto wildcarded regex

Posted: 28 Nov 2018 22:14
by Nighted
Excellent! :appl: