eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
20.08k stars 2.5k forks source link

Cannot overwrite vim key binding #14158

Open dev-jwel opened 2 months ago

dev-jwel commented 2 months ago

Bug Description:

Default key binding mapping is not working after vim extension key binding has removed.

Steps to Reproduce:

1, Install the vim extension vscodevim.vim.

  1. Remove keybinding extension.vim_ctrl+w.
  2. Try to close tab using Ctrl+W shortcut.
    • This bug occurs on only file editing tabs but other tabs like setting tab can be closed by Ctrl+W.

Additional Information

tsmaeder commented 2 months ago

I'm not sure I understand the problem. There is "Remove Keybinding" and "Reset Keybinding". If you remove a keybinding, the effect is that you mark the keybinding as removed. To revert to the default keybinding, you'd have to reset the keybinding.

dev-jwel commented 2 months ago

Removal of keybinding is expected behavior as you said, but It doesn't. When IDE has installed at the first time, there is a command View: Close Tab in Main Area with keybinding Ctrl+W and it works fine at this time. If vim extension has installed on the IDE, it covers default keybinding and it might be an expected. And also removing the command extension.vim_ctrl+w with keybinding Ctrl+W should make default keybinding work but still not working. This unexpected behavior disappears when vim extension has uninstalled.

tsmaeder commented 2 months ago

That's not how it works: when you install the vim extension, you override the keybinding in the default scope. When you remove the keybinding you're adding a "removal" of the default binding in the user scope. To restore the old default keybinding, you have to remove the vim extension or rebind the key to whatever you want. One might argue this is not the desired behavior, but it works as designed.

tsmaeder commented 2 months ago

Just out of interest: what does VS Code do in this case?

dev-jwel commented 2 months ago

For vscode and vscodium, default binding is working after extension keybinding has removed. I'm guessing that the binding is working by its priority, but I don't know about its detailed implementation.