82 Commits

Author SHA1 Message Date
Kovid Goyal
97f1d7f436 Implement session command to set layout state 2025-08-06 20:43:12 +05:30
Kovid Goyal
bdf3b9300e Make creation of window_id_map generic 2025-08-04 16:28:06 +05:30
Kovid Goyal
16e659c477 DRYer 2025-08-04 16:16:55 +05:30
Kovid Goyal
1665b06d59 Implement set_layout_state for a few remaining layouts 2025-08-04 16:02:19 +05:30
Kovid Goyal
e6f35571a5 Implement full serialization/unserialization for layouts
Need to go over all the non-split layouts and see if they need
any TLC
2025-08-04 15:51:46 +05:30
Kovid Goyal
6d2b17d877 opts serialization is done by base class 2025-08-02 12:49:06 +05:30
Kovid Goyal
bbbeeb8206 More rigorous set layout state sanity check 2025-08-02 12:48:04 +05:30
Kovid Goyal
c4ed1d3b69 Implement unserialization for splits layout
Also cleanup the serialization code.
2025-08-02 12:12:40 +05:30
Kovid Goyal
d548a6fcf4 rename typing module to avoid conflicts with stdlib typing 2025-04-28 09:20:10 +05:30
Kovid Goyal
167e6e73f7 Fix #8529 2025-04-11 09:33:52 +05:30
Kovid Goyal
07a7b23223 Fix #8302 2025-02-08 08:21:22 +05:30
Kovid Goyal
244f4597dc launch: Decouple source and dest windows from active window
Fixes #8295
2025-02-07 13:40:44 +05:30
Kovid Goyal
da1626090a Update codebase to Python 3.10 using pyupgrade 2025-02-03 10:56:50 +05:30
Kovid Goyal
9bf44f0b85 oops 2025-01-17 20:28:59 +05:30
Kovid Goyal
069868f89d Splits layout: Special case move_to_edge when there is a single split to preserve bias 2025-01-17 08:41:54 +05:30
Kovid Goyal
c600451bb8 Splits layout: Allow setting the bias of the current split using layout_action bias
Fixes #8222
2025-01-17 08:37:07 +05:30
Kovid Goyal
9d48fa9126 hints/unicode_input kittens: Do not lose keypresses that are sent very rapidly via an automation tool immediately after the kitten is launched
We now buffer the key events until the kitten tells us it is ready.
Without this the key presses are delivered to the underlying window
as the kitten's overlay window was not being focused until the kitten
set the ready message.

Fixes #7089
2024-12-12 13:11:12 +05:30
Kovid Goyal
62fbda8c9b When re-attaching a detached tab preserve internal layout state such as biases and orientations
Fixes #8106
2024-12-06 19:54:10 +05:30
Kovid Goyal
d02b1c0b31 ... 2024-09-24 14:38:11 +05:30
Kovid Goyal
83c989d4e9 Splits layout: Allow setting the split_axis option to auto so that all new windows have their split axis chosen automatically unless explicitly specified in the launch command
Fixes #7887
2024-09-24 14:21:23 +05:30
Kovid Goyal
5ab484cac2 Implement --bias for the grid layout 2024-07-20 13:11:06 +05:30
Kovid Goyal
92385f6db7 Make function re-useable and simplify bias docs a bit 2024-07-20 12:44:46 +05:30
Kovid Goyal
681048f1ca launch command: A new --bias option to adjust the size of newly created windows declaratively
Still need to implement it for the Grid layout.
Fixes #7634
2024-07-20 12:37:18 +05:30
Kovid Goyal
04735eb072 ... 2024-07-15 22:21:21 +05:30
Kovid Goyal
e0a7d25dda Splits layout: Fix the move_to_screen_edge action breaking when only a single window is present
Fixes #7621
2024-07-12 12:13:31 +05:30
Johannes Wüller
7c8660a694 Extend placement_stragegy options
placement_strategy previously only accepted 'center' and 'top-left', but
others are potentially useful too. I personally like 'bottom-left'. The
new set of accepted values mirrors the window_logo_position option.
2024-05-08 16:33:04 +02:00
Kovid Goyal
cd5099d6f7 Splits layout: Fix move_window_forward not working
Fixes #7264
2024-03-26 08:21:03 +05:30
Kovid Goyal
039d144c84 Splits layout: Allow resizing until one of the halves in a split is minimally sized
Fixes #7220
2024-03-14 15:59:23 +05:30
Kovid Goyal
2a5ba519f5 Fix #6923 2023-12-17 10:50:18 +05:30
Kovid Goyal
856fddec3c Tall/fat layout: When changing the number of full size windows, reset the main axis biases. Fixes #6123 2023-03-20 22:36:18 +05:30
Kovid Goyal
fccd776732 Fix overlay windows not inheriting the per-window padding and margin settings of their parents
Fixes #6063
2023-03-01 21:45:17 +05:30
Kovid Goyal
7fe5d7b58f Replace isort with ruff 2023-01-09 16:47:42 +05:30
Kovid Goyal
2e8ef66496 Another mypy update another round of spurious errors 2022-11-08 17:17:40 +05:30
Kovid Goyal
f5de08d5fa Splits layout: Add a new mappable action to move the active window to the screen edge
Fixes #5643
2022-11-03 17:40:04 +05:30
ms-test
aab149366d Check correct pair member
I haven't looked deeply, but this looked to be a simple typo unless it's checking one both times because of a type invariant. If that is the case, and the check is correct, then a comment and/or code refactoring to call attention to this would likely be a good idea.
2022-10-16 03:53:16 -04:00
Kovid Goyal
2a5922ce92 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.
2022-08-05 08:12:05 +05:30
Steven Moazami
adfcbb004f Add layout_action to change bias on tall layout
Can specify 1 bias to toggle between that and 50%.

Can specify multiple biases to rotate through them with each call to the
layout_action.

Left a comment regarding working around either a possible bug or a
design decision.
2022-08-04 19:29:17 -04:00
Kovid Goyal
a9a9f1ac00 Add a mappable action to toggle the mirrored setting for the tall and fat layouts
Fixes #5344
2022-08-03 22:45:38 +05:30
Kovid Goyal
c40ef01445 Fix resizing window that is extra tall/wide because of left-over cells not working reliably
Fixes #4913
2022-04-08 15:41:53 +05:30
Kovid Goyal
ab8a4c6b9f Make per cell bias calculation overridable more easily 2022-04-08 14:52:53 +05:30
Kovid Goyal
6dc1617429 Avoid flicker when starting kittens such as the hints kitten
Fixes #4674
2022-03-23 15:55:11 +05:30
Kovid Goyal
ba1b3c3c2d Fix mypy failures 2022-03-12 08:28:43 +05:30
Kovid Goyal
31a5965b01 Splits layout: A new value for :option:launch --location to auto-select the split axis when splitting existing windows. 2022-02-22 22:37:26 +05:30
pagedown
ba0f61d752 Refactor: More f-string for kitty 2022-01-29 20:17:46 +08:00
Kovid Goyal
4c8ef26141 For the vertical and horizontal layouts have the windows arranged on a ring rather than a plane. This means the first and last window are considered neighbors
Fixes #4494
2022-01-11 08:08:11 +05:30
pagedown
f1b6fb397b Remove redundant variable assignment 2022-01-01 21:28:55 +08:00
Kovid Goyal
d090db380f Add more type annotations 2021-10-27 13:26:18 +05:30
Kovid Goyal
4494ddd8ff mypy: Turn on return value checks
Its a shame GvR is married to "return None"
https://github.com/python/mypy/issues/7511
2021-10-26 22:39:14 +05:30
Kovid Goyal
0e08c6c660 Fix a one pixel line not being drawn at the bottom edge of the fat and tall layouts 2021-10-25 15:28:49 +05:30
Kovid Goyal
4fd76b09d9 kitty @ ls: Also report layout options 2021-10-21 13:44:06 +05:30