lite-xl-plugins icon indicating copy to clipboard operation
lite-xl-plugins copied to clipboard

[Request] Settings: add duplicate keybindings warning

Open thdoan opened this issue 2 years ago • 2 comments

Right now you can create duplicate keybindings through the Settings GUI. This can lead to some problems, like when you remap line-wrapping:toggle to ctrl+w and now you can no longer close documents with Ctrl+W even though the hint still shows this:

image

I can think of a couple options:

  1. Add a dialog to notify of a keybinding conflict, and if the user chooses to save the new binding then it should clear the old binding.
  2. Don't show a dialog, but instead automatically clear the old binding when it is mapped to another command.

thdoan avatar May 05 '23 09:05 thdoan

The thing is that lite-xl actually supports duplicated bindings for every command, what determines which command takes precedence after pressing a keybinding is the predicate associated to the command.

Maybe a warning could be displayed letting you know all the other commands where the same keybinding is assigned, but there will not be an easy way to determine if the predicate of the different commands conflict. As such it would not be correct to unassign a keybinding from other commands when assigning the same keybinding to a command.

jgmdev avatar May 05 '23 19:05 jgmdev

The thing is that lite-xl actually supports duplicated bindings for every command...

I noticed after I binded ctrl+w to line wrapping, I was no longer able to close windows by pressing Ctrl+W.

thdoan avatar May 05 '23 21:05 thdoan