4coder » Forums » Creating a command palette with the new lister API?
plb
9 posts
#15926 Creating a command palette with the new lister API?
2 weeks ago Edited by plb on Aug. 5, 2018, 9:16 p.m. Reason: Initial post

Allen, per the subject, do you think it would be possible to create a command palette using the new lister API? I'm thinking along the lines of sublimetext, atom, fman, etc -- would be really handy since I find myself frequently searching through the 4coder keybindings documentation.

It seems like it ought to be doable -- press ctrl-p or whatever, start typing a command, and with each keystroke refine a list of matching commands, similar to the way that file picking works right now.
Mr4thDimention
Allen Webster
402 posts / 2 projects

Heyo

#15929 Creating a command palette with the new lister API?
2 weeks ago Edited by Allen Webster on Aug. 6, 2018, 5:53 a.m.

Absolutely! This is probably the very first thing I will add once I'm done porting existing UIs over.

I haven't looked at what sublimetext or atom or anyone else really does for this type of feature. I used to use it occasionally in emacs but I never really "got it" so it's probably worth my time to study it properly before I just throw something out there.

Luckily I already have a parser that extracts all of the command metadata. Names, descriptions, and when linked to the rest of the custom code even the function pointers to the commands, which means all that I need is to get you a UI to view and navigate that data :D
plb
9 posts
#15933 Creating a command palette with the new lister API?
2 weeks ago

Oh I had no idea this was on your todo list, great!

I used emacs for years, I have a soft spot for it, but it's autocomplete within in the minibuffer (or whatever it's properly called) is pretty mediocre. I think SublimeText has the best implementation here, ctrl-shift-p and start typing, it thins down the list of fuzzy-matched commands with each key stroke, and also shows the relevant keyboard shortcut so if you keep running the same command over and over you eventually come to memorize the key-combo organically.