mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-11 01:28:19 +03:00
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
This commit is contained in:
parent
7023c7a8ae
commit
4c8ef26141
@ -85,6 +85,10 @@ Detailed list of changes
|
||||
- hints kitten: Fix common single letter extension files not being detected
|
||||
(:iss:`4491`)
|
||||
|
||||
- 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 (:iss:`4494`)
|
||||
|
||||
|
||||
0.24.1 [2022-01-06]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -123,8 +123,12 @@ class Vertical(Layout):
|
||||
assert wg is not None
|
||||
groups = tuple(all_windows.iter_all_layoutable_groups())
|
||||
idx = groups.index(wg)
|
||||
before = [] if wg is groups[0] else [groups[idx-1].id]
|
||||
after = [] if wg is groups[-1] else [groups[idx+1].id]
|
||||
lg = len(groups)
|
||||
if lg > 1:
|
||||
before = [groups[(idx - 1 + lg) % lg].id]
|
||||
after = [groups[(idx + 1) % lg].id]
|
||||
else:
|
||||
before, after = [], []
|
||||
if self.main_is_horizontal:
|
||||
return {'left': before, 'right': after, 'top': [], 'bottom': []}
|
||||
return {'top': before, 'bottom': after, 'left': [], 'right': []}
|
||||
|
Loading…
Reference in New Issue
Block a user