mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 08:26:56 +00:00
Splits layout: Fix the move_to_screen_edge action breaking when only a single window is present
Fixes #7621
This commit is contained in:
parent
870607aa38
commit
e0a7d25dda
2 changed files with 23 additions and 15 deletions
|
|
@ -90,6 +90,8 @@ Detailed list of changes
|
|||
|
||||
- Wayland: Fix an issue with mouse selections not being stopped when there are multiple OS windows (:iss:`7381`)
|
||||
|
||||
- Splits layout: Fix the ``move_to_screen_edge`` action breaking when only a single window is present (:iss:`7621`)
|
||||
|
||||
0.35.2 [2024-06-22]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
|||
|
|
@ -601,21 +601,27 @@ class Splits(Layout):
|
|||
pair.one, pair.two = pair.two, pair.one
|
||||
return True
|
||||
elif action_name == 'move_to_screen_edge':
|
||||
args = args or ('left',)
|
||||
which = args[0]
|
||||
horizontal = which in ('left', 'right')
|
||||
wg = all_windows.active_group
|
||||
if wg is not None:
|
||||
self.remove_windows(wg.id)
|
||||
new_root = Pair(horizontal)
|
||||
if which in ('left', 'top'):
|
||||
new_root.balanced_add(wg.id)
|
||||
new_root.two = self.pairs_root
|
||||
else:
|
||||
new_root.one = self.pairs_root
|
||||
new_root.two = wg.id
|
||||
self.pairs_root = new_root
|
||||
return True
|
||||
count = 0
|
||||
for wid in self.pairs_root.all_window_ids():
|
||||
count += 1
|
||||
if count > 1:
|
||||
break
|
||||
if count > 1:
|
||||
args = args or ('left',)
|
||||
which = args[0]
|
||||
horizontal = which in ('left', 'right')
|
||||
wg = all_windows.active_group
|
||||
if wg is not None:
|
||||
self.remove_windows(wg.id)
|
||||
new_root = Pair(horizontal)
|
||||
if which in ('left', 'top'):
|
||||
new_root.balanced_add(wg.id)
|
||||
new_root.two = self.pairs_root
|
||||
else:
|
||||
new_root.one = self.pairs_root
|
||||
new_root.two = wg.id
|
||||
self.pairs_root = new_root
|
||||
return True
|
||||
|
||||
return None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue