mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 10:12:17 +02:00
dedup choice literals
This commit is contained in:
4
kitty/options/parse.py
generated
4
kitty/options/parse.py
generated
@@ -1140,7 +1140,7 @@ class Parser:
|
||||
raise ValueError(f"The value {val} is not a valid choice for pointer_shape_when_dragging")
|
||||
ans["pointer_shape_when_dragging"] = val
|
||||
|
||||
choices_for_pointer_shape_when_dragging = frozenset(('arrow', 'beam', 'text', 'pointer', 'hand', 'help', 'wait', 'progress', 'crosshair', 'vertical-text', 'move', 'e-resize', 'ne-resize', 'nw-resize', 'n-resize', 'se-resize', 'sw-resize', 's-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', 'alias', 'copy', 'not-allowed', 'no-drop', 'grab', 'grabbing'))
|
||||
choices_for_pointer_shape_when_dragging = choices_for_default_pointer_shape
|
||||
|
||||
def pointer_shape_when_grabbed(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
|
||||
val = val.lower()
|
||||
@@ -1148,7 +1148,7 @@ class Parser:
|
||||
raise ValueError(f"The value {val} is not a valid choice for pointer_shape_when_grabbed")
|
||||
ans["pointer_shape_when_grabbed"] = val
|
||||
|
||||
choices_for_pointer_shape_when_grabbed = frozenset(('arrow', 'beam', 'text', 'pointer', 'hand', 'help', 'wait', 'progress', 'crosshair', 'vertical-text', 'move', 'e-resize', 'ne-resize', 'nw-resize', 'n-resize', 'se-resize', 'sw-resize', 's-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', 'alias', 'copy', 'not-allowed', 'no-drop', 'grab', 'grabbing'))
|
||||
choices_for_pointer_shape_when_grabbed = choices_for_default_pointer_shape
|
||||
|
||||
def remember_window_size(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
|
||||
ans['remember_window_size'] = to_bool(val)
|
||||
|
||||
4
kitty/options/types.py
generated
4
kitty/options/types.py
generated
@@ -21,8 +21,8 @@ choices_for_linux_display_server = typing.Literal['auto', 'wayland', 'x11']
|
||||
choices_for_macos_colorspace = typing.Literal['srgb', 'default', 'displayp3']
|
||||
choices_for_macos_show_window_title_in = typing.Literal['all', 'menubar', 'none', 'window']
|
||||
choices_for_placement_strategy = typing.Literal['center', 'top-left']
|
||||
choices_for_pointer_shape_when_dragging = typing.Literal['arrow', 'beam', 'text', 'pointer', 'hand', 'help', 'wait', 'progress', 'crosshair', 'vertical-text', 'move', 'e-resize', 'ne-resize', 'nw-resize', 'n-resize', 'se-resize', 'sw-resize', 's-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', 'alias', 'copy', 'not-allowed', 'no-drop', 'grab', 'grabbing']
|
||||
choices_for_pointer_shape_when_grabbed = typing.Literal['arrow', 'beam', 'text', 'pointer', 'hand', 'help', 'wait', 'progress', 'crosshair', 'vertical-text', 'move', 'e-resize', 'ne-resize', 'nw-resize', 'n-resize', 'se-resize', 'sw-resize', 's-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', 'alias', 'copy', 'not-allowed', 'no-drop', 'grab', 'grabbing']
|
||||
choices_for_pointer_shape_when_dragging = choices_for_default_pointer_shape
|
||||
choices_for_pointer_shape_when_grabbed = choices_for_default_pointer_shape
|
||||
choices_for_strip_trailing_spaces = typing.Literal['always', 'never', 'smart']
|
||||
choices_for_tab_bar_align = typing.Literal['left', 'center', 'right']
|
||||
choices_for_tab_bar_style = typing.Literal['fade', 'hidden', 'powerline', 'separator', 'slant', 'custom']
|
||||
|
||||
Reference in New Issue
Block a user