diff options
Diffstat (limited to 'src/Finder.zig')
| -rw-r--r-- | src/Finder.zig | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Finder.zig b/src/Finder.zig index a2b8f89f..e72a8dab 100644 --- a/src/Finder.zig +++ b/src/Finder.zig @@ -73,6 +73,8 @@ pub fn place(f: *Finder, p: *Pardes, id: usize) bool { fn open(f: *Finder, p: *Pardes) ?usize { if (p.ncol >= pardes.MAX_COLS or p.ncol == 0) return null; if (p.screen_w < @as(u32, config.MINW) * @as(u32, @intCast(p.ncol + 1))) return null; + const before_min = layout.minima(p); + const before = p.rects; const c = p.ncol; p.col_n[c] = 0; // Not used for its width (layout.compute), only kept positive for the @@ -83,11 +85,12 @@ fn open(f: *Finder, p: *Pardes) ?usize { p.col_serial[c] = 0; p.ncol += 1; f.serial = layout.columnSerial(p, c); - // A narrower column wraps long tags onto more rows: shared out again, - // and where that cannot hold every minimum there is no finder, as - // Newcol is refused. - layout.compute(p); - for (0..p.ncol) |k| if (k != c and !layout.columnAtMinimums(p, k) and !layout.shareColumn(p, k)) { + // A narrower column wraps long tags onto more rows: those rows back + // from the panes with rows to spare, shared out again only where that + // is not enough, and where nothing holds every minimum there is no + // finder, as Newcol is refused. + layout.restoreMinimaFrom(p, &before, &before_min); + for (0..p.ncol) |k| if (k != c and layout.squeezed(p, k, &before, &before_min) and !layout.shareColumn(p, k)) { layout.dropColumnUnannounced(p, c); f.serial = 0; layout.compute(p); |
