mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-15 13:04:38 +02:00
Make the repr of SingleKey shorter
This commit is contained in:
@@ -52,6 +52,14 @@ class SingleKey(NamedTuple):
|
||||
is_native: bool = False
|
||||
key: int = -1
|
||||
|
||||
def __repr__(self) -> str:
|
||||
kwds = []
|
||||
for i, f in enumerate(self._fields):
|
||||
val = self[i]
|
||||
if val != self._field_defaults[f]:
|
||||
kwds.append(f'{f}={val!r}')
|
||||
return 'SingleKey(' + ', '.join(kwds) + ')'
|
||||
|
||||
|
||||
class MouseEvent(NamedTuple):
|
||||
button: int = 0
|
||||
|
||||
Reference in New Issue
Block a user