mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 11:11:47 +02: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:
@@ -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`)
|
- 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]
|
0.35.2 [2024-06-22]
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|||||||
@@ -601,21 +601,27 @@ class Splits(Layout):
|
|||||||
pair.one, pair.two = pair.two, pair.one
|
pair.one, pair.two = pair.two, pair.one
|
||||||
return True
|
return True
|
||||||
elif action_name == 'move_to_screen_edge':
|
elif action_name == 'move_to_screen_edge':
|
||||||
args = args or ('left',)
|
count = 0
|
||||||
which = args[0]
|
for wid in self.pairs_root.all_window_ids():
|
||||||
horizontal = which in ('left', 'right')
|
count += 1
|
||||||
wg = all_windows.active_group
|
if count > 1:
|
||||||
if wg is not None:
|
break
|
||||||
self.remove_windows(wg.id)
|
if count > 1:
|
||||||
new_root = Pair(horizontal)
|
args = args or ('left',)
|
||||||
if which in ('left', 'top'):
|
which = args[0]
|
||||||
new_root.balanced_add(wg.id)
|
horizontal = which in ('left', 'right')
|
||||||
new_root.two = self.pairs_root
|
wg = all_windows.active_group
|
||||||
else:
|
if wg is not None:
|
||||||
new_root.one = self.pairs_root
|
self.remove_windows(wg.id)
|
||||||
new_root.two = wg.id
|
new_root = Pair(horizontal)
|
||||||
self.pairs_root = new_root
|
if which in ('left', 'top'):
|
||||||
return True
|
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
|
return None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user