onivim / oni

Oni: Modern Modal Editing - powered by Neovim
https://www.onivim.io
MIT License
11.35k stars 301 forks source link

Check Command Registering API #2507

Open CrossR opened 6 years ago

CrossR commented 6 years ago

There has been a few issues about a few of the commands in the command pallete not working, mainly the bufferlist ones.

I think this comes down to the buffer list checking if a menu is open, and if one is, it will not open the buffer list. Which is the most sensible approach, but means that the command pallete option does not work. Then, since the command is registered in Oni, it appears in the menu when it will never work from that menu.

Instead, does Oni need some way of setting a command as a keybind only? We want the command to be available everywhere, but we also don't really want it in the command pallete. That, or some way of more inteligently reacting to the command pallete, so the plugins can react to it.

Ie, I'm suggesting that for Oni.command.registerCommand, there be some optional flag to say "This command is a keybind" so it doesn't necessarily appear in the command pallete.

TalAmuyal commented 6 years ago

I rather like it there since it is find-able this way. How about adding some short warning/explanation in the commands description?

On Thu, Aug 16, 2018 at 7:02 PM Ryan C notifications@github.com wrote:

There has been a few issues about a few of the commands in the command pallete not working, mainly the bufferlist ones.

I think this comes down to the buffer list checking if a menu is open, and if one is, it will not open the buffer list. Which is the most sensible approach, but means that the command pallete option does not work. Then, since the command is registered in Oni, it appears in the menu when it will never work from that menu.

Instead, does Oni need some way of setting a command as a keybind only? We want the command to be available everywhere, but we also don't really want it in the command pallete. That, or some way of more inteligently reacting to the command pallete, so the plugins can react to it.

Ie, I'm suggesting that for Oni.command.registerCommand, there be some optional flag to say "This command is a keybind" so it doesn't necessarily appear in the command pallete.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/onivim/oni/issues/2507, or mute the thread https://github.com/notifications/unsubscribe-auth/AE3IjaRRPTCadbJ5u6Z674Fg52D6y5i7ks5uRZejgaJpZM4WAJV4 .

akinsho commented 6 years ago

@CrossR I agree re. filtering out I get @TalAmuyal point re. visibility but tbh I think its confusing ux to have ineffective commands and also tbh the vast majority of the commands that ive "added" to it werent intended to show up there there just wasn't a way to prevent that I think command discoverability should come through maybe an oni help section in app but the command palette should be reserved for functionality users can activate via that menu a la vscode or atom etc. (my two cents) re. potential implementation could add a flag to Command creation to check if the command should be rendered and in the menu just filter out ones which shouldn't render