mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-01-30 14:58:38 +00:00
console: keymap - list keys with modifiers separately
This commit is contained in:
parent
4a7cafee9e
commit
09128d9d1a
@ -1,6 +1,6 @@
|
||||
|
||||
def map(km):
|
||||
km.add(":", "console.command ''", ["global"], "Command prompt")
|
||||
km.add(":", "console.command ", ["global"], "Command prompt")
|
||||
km.add("?", "console.view.help", ["global"], "View help")
|
||||
km.add("C", "console.view.commands", ["global"], "View commands")
|
||||
km.add("K", "console.view.keybindings", ["global"], "View key bindings")
|
||||
|
@ -60,9 +60,12 @@ class Keymap:
|
||||
return None
|
||||
|
||||
def list(self, context: str) -> typing.Sequence[Binding]:
|
||||
b = [b for b in self.bindings if context in b.contexts or context == "all"]
|
||||
b.sort(key=lambda x: x.key)
|
||||
return b
|
||||
b = [x for x in self.bindings if context in x.contexts or context == "all"]
|
||||
single = [x for x in b if len(x.key.split()) == 1]
|
||||
multi = [x for x in b if len(x.key.split()) != 1]
|
||||
single.sort(key=lambda x: x.key)
|
||||
multi.sort(key=lambda x: x.key)
|
||||
return single + multi
|
||||
|
||||
def handle(self, context: str, key: str) -> typing.Optional[str]:
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user