mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-18 06:25:13 +02:00
Improve formatting of config diff for modify_font
This commit is contained in:
@@ -95,6 +95,9 @@ def compare_opts(opts: KittyOpts, print: Print) -> None:
|
|||||||
if f == 'symbol_map':
|
if f == 'symbol_map':
|
||||||
for k in sorted(val):
|
for k in sorted(val):
|
||||||
print(f'\tU+{k[0]:04x} - U+{k[1]:04x} → {val[k]}')
|
print(f'\tU+{k[0]:04x} - U+{k[1]:04x} → {val[k]}')
|
||||||
|
elif f == 'modify_font':
|
||||||
|
for k in sorted(val):
|
||||||
|
print(' ', val[k])
|
||||||
else:
|
else:
|
||||||
print(pformat(val))
|
print(pformat(val))
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -41,8 +41,16 @@ class ModificationValue(NamedTuple):
|
|||||||
val: float
|
val: float
|
||||||
unit: ModificationUnit
|
unit: ModificationUnit
|
||||||
|
|
||||||
|
def __repr__(self) -> str:
|
||||||
|
u = '%' if self.unit is ModificationUnit.percent else ''
|
||||||
|
return f'{self.val:g}{u}'
|
||||||
|
|
||||||
|
|
||||||
class FontModification(NamedTuple):
|
class FontModification(NamedTuple):
|
||||||
mod_type: ModificationType
|
mod_type: ModificationType
|
||||||
mod_value: ModificationValue
|
mod_value: ModificationValue
|
||||||
font_name: str = ''
|
font_name: str = ''
|
||||||
|
|
||||||
|
def __repr__(self) -> str:
|
||||||
|
fn = f' {self.font_name}' if self.font_name else ''
|
||||||
|
return f'{self.mod_type.name}{fn} {self.mod_value}'
|
||||||
|
|||||||
Reference in New Issue
Block a user