Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Settings: add duplicate keybindings warning #243

Open
thdoan opened this issue May 5, 2023 · 2 comments
Open

[Request] Settings: add duplicate keybindings warning #243

thdoan opened this issue May 5, 2023 · 2 comments

Comments

@thdoan
Copy link

thdoan commented May 5, 2023

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.
@jgmdev
Copy link
Member

jgmdev commented May 5, 2023

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.

@thdoan
Copy link
Author

thdoan commented May 5, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants