Fix a regression that caused closing an overlay window to focus the previously focused window rather than the underlying window

Fixes #1720
This commit is contained in:
Kovid Goyal
2019-06-17 09:00:47 +05:30
parent 38bc90f724
commit 603533e632
2 changed files with 9 additions and 0 deletions

View File

@@ -268,6 +268,12 @@ class Tab: # {{{
next_window_id = self.windows[idx].id
active_window_idx = self.current_layout.remove_window(self.windows, window, self.active_window_idx)
remove_window(self.os_window_id, self.id, window.id)
if window.overlay_for is not None:
for idx, q in enumerate(self.windows):
if q.id == window.overlay_for:
active_window_idx = idx
next_window_id = q.id
break
if next_window_id is None and active_window_idx is not None and len(self.windows) > active_window_idx:
next_window_id = self.windows[active_window_idx].id
if next_window_id is not None: