From 2a5922ce921969cc626ad114ac60ede8e1bbab50 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 5 Aug 2022 08:12:05 +0530 Subject: [PATCH] Cleanup previous PR The reason maxsplit is 1 is because some layout action in the future may need more sophisticated args processing, for example, shlex.split() instead of plain split(), or even a full command line parser. --- docs/changelog.rst | 3 +++ kitty/layout/tall.py | 8 ++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 4546113af..a52fb01a9 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -63,6 +63,9 @@ Detailed list of changes - Add a mappable action to toggle the mirrored setting for the tall and fat layouts (:pull:`5344`) +- Add a mappable action to switch between predefined bias values for the tall and fat + layouts (:pull:`5352`) + - Wayland: Reduce flicker at startup by not using render frames immediately after a resize (:iss:`5235`) - Linux: Update cursor position after all key presses not just pre-edit text diff --git a/kitty/layout/tall.py b/kitty/layout/tall.py index 1ae08f8d7..672621171 100644 --- a/kitty/layout/tall.py +++ b/kitty/layout/tall.py @@ -54,7 +54,7 @@ def neighbors_for_tall_window( class TallLayoutOpts(LayoutOpts): - bias: 50 + bias: int = 50 full_size: int = 1 mirrored: bool = False @@ -78,6 +78,7 @@ class TallLayoutOpts(LayoutOpts): b = max(0.1, min(b, 0.9)) return tuple(repeat(b / self.full_size, self.full_size)) + (1.0 - b,) + class Tall(Layout): name = 'tall' @@ -220,11 +221,6 @@ class Tall(Layout): if action_name == 'bias': if len(args) == 0: raise ValueError('layout_action bias must contain at least one number between 10 and 90') - # Because kitty/options/utils.py:312 sets maxsplit=1, line 315 will always - # pass args as a tuple consisting of at most 1 element with all the args despite - # it implying the tuple could have more than one element with via [1:] - # In case this is by design and I'm missing the reason, have to split out - # the rest of the args: biases = args[0].split() if len(biases) == 1: biases.append("50")