acme: fix hiding of top windows when loading a dump file (thanks Xiao-Yong)

When loading an acme dump file that contains a window with only one
tag line, there are cases where acme hides that window (i.e.  not even
its tag is visible).

The following commands reproduce the issue:

 % ed <<EOE
1
i
/tmp
/lib/font/bit/pelm/unicode.8.font
/lib/font/bit/pelm/unicode.8.font
          0
f          0           5         175         175           1
          5          40         175           1           0 /sys/src/cmd/acme/ Del Snarf Get | Look
f          0           4         330         330           3
          4          27         330           1           0 /tmp/ Del Snarf Get | Look
.
,w /tmp/test.dump
Q
EOE
 % window -dx 900 -dy 600  'acme -l /tmp/test.dump'

This issue was introduced in commit 47b7dc5ccd.
This commit is contained in:
Igor Böhm 2022-03-15 10:49:00 +00:00
parent ca313087c1
commit 873f381e29

View file

@ -188,6 +188,8 @@ winresize(Window *w, Rectangle r, int safe, int fillfringe)
w->taglines = wintaglines(w, r);
r1.max.y = min(r.max.y, r1.min.y + w->taglines*font->height);
}
if(Dy(r1) < font->height)
r1.max.y = r1.min.y+font->height;
/* If needed, resize & redraw tag. */
y = r1.max.y;
if(!safe || !w->tagsafe || !eqrect(w->tag.r, r1)){