Repository navigation
Allow unbinding a key by description or from a submap #15040
Replies: 4 comments 5 replies
|
but submaps already override binds unless you use submap_universal = true in bind flags |
Well you'll be happy to know that this is how it already works. A ton of advanced features are only documented in the LSP definitions in foo = hl.bind('X', ...)
foo:unbind() |
|
Any updates on this? I really need this feature. I am creating submaps dynamically based on other events, and the binds inside them are multiplying every time. Normally, clearing the old bind before creating them again would instantly fix the issue, except the problem is that unbind clears the key from all submaps |
|
I just checked, for some reason bind:set_enabled works by only disabling that specific bind but bind:remove and bind:unbind will unregister the binding in all submaps |
Uh oh!
There was an error while loading. Please reload this page.
Problem
The
hl.unbindcommand unbinds every instance of the key specified from every context that it is used in (i.e. from the top level and within every submap).This additional functionality would be helpful to allow users to target a specific context where a key is used, or a specific instance of a key, when unbinding. This would be especially useful for submaps where users may want to dynamically generate/delete keybinds during runtime (that's my usecase) to enable more sophisticated dynamic keybind generation via Lua without accidentally/unintentionally deleting the same key that is used elsewhere.
Expected Result
Allow
hl.unbindto acceptopts = {}for filtering the scope of the unbind to target a key within a specific submaps or by description.Or, if simpler, allow unbinding via a saved variable like how disabling a workspace rule works.
All reactions