mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-28 12:21:55 +00:00
DRYer
This commit is contained in:
parent
2f7b0d1d94
commit
7f1c371b6e
2 changed files with 5 additions and 1 deletions
|
|
@ -113,7 +113,7 @@ def compare_opts(opts: KittyOpts, print: Print) -> None:
|
|||
seen = set()
|
||||
uniq = []
|
||||
for d in reversed(defns):
|
||||
key = d.full_key_sequence_to_trigger, d.options.when_focus_on
|
||||
key = d.unique_identity_within_keymap
|
||||
if key not in seen:
|
||||
seen.add(key)
|
||||
uniq.append(d)
|
||||
|
|
|
|||
|
|
@ -1211,6 +1211,10 @@ class KeyDefinition(BaseDefinition):
|
|||
def full_key_sequence_to_trigger(self) -> Tuple[SingleKey, ...]:
|
||||
return (self.trigger,) + self.rest
|
||||
|
||||
@property
|
||||
def unique_identity_within_keymap(self) -> Tuple[Tuple[SingleKey, ...], str]:
|
||||
return self.full_key_sequence_to_trigger, self.options.when_focus_on
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return self.pretty_repr('is_sequence', 'trigger', 'rest', 'options')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue