diff options
author | Igor Böhm <igor@9lab.org> | 2022-03-15 10:49:00 +0000 |
---|---|---|
committer | Igor Böhm <igor@9lab.org> | 2022-03-15 10:49:00 +0000 |
commit | 873f381e29d4e045075f842bd8a453bdbf2b6c45 (patch) | |
tree | 3b9608619a95c9aa393e1d3bc77b05de618dcca3 /sys/src/cmd/acme/wind.c | |
parent | ca313087c1715a0331a58c01ad104632d366f057 (diff) |
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 47b7dc5ccd77bc247ab15cfab3a7a8f955771c70.
Diffstat (limited to 'sys/src/cmd/acme/wind.c')
-rw-r--r-- | sys/src/cmd/acme/wind.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/src/cmd/acme/wind.c b/sys/src/cmd/acme/wind.c index c18ddb71a..5f8c39fd0 100644 --- a/sys/src/cmd/acme/wind.c +++ b/sys/src/cmd/acme/wind.c @@ -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)){ |