Fix a regression in the previous release that broke switching to neighboring windows in the Grid layout when there are less than four windows

Fixes #2377
This commit is contained in:
Kovid Goyal 2020-02-19 15:27:56 +05:30
parent 65cc9f4e1b
commit 4a191b65bb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 0 deletions

View File

@ -46,6 +46,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- macOS: When switching input method while a pending multi-key input is in - macOS: When switching input method while a pending multi-key input is in
progress, clear the pending input (:iss:`2358`) progress, clear the pending input (:iss:`2358`)
- Fix a regression in the previous release that broke switching to neighboring windows
in the Grid layout when there are less than four windows (:iss:`2377`)
0.16.0 [2020-01-28] 0.16.0 [2020-01-28]
-------------------- --------------------

View File

@ -839,6 +839,7 @@ class Grid(Layout):
def neighbors_for_window(self, window, windows): def neighbors_for_window(self, window, windows):
n = len(windows) n = len(windows)
if n < 4: if n < 4:
self.num_full_size_windows = 1
return Tall.neighbors_for_window(self, window, windows) return Tall.neighbors_for_window(self, window, windows)
ncols, nrows, special_rows, special_col = calc_grid_size(n) ncols, nrows, special_rows, special_col = calc_grid_size(n)
blank_row = [None for i in range(ncols)] blank_row = [None for i in range(ncols)]