Commit d913076
committed
Shrink terminal when tall glyphs push content off-screen
Emoji and other Unicode characters can fall back to taller fonts in
Emacs, expanding line height beyond what window-body-height assumes.
After enough such lines the bottom rows are pushed below the visible
window area.
After each redraw, check whether the last buffer position is still
visible. When it is not, reduce the terminal by one row and
re-render so all content fits. The adjustment is reset on window
resize so the terminal reclaims full height when possible.
Benchmarks show no regression (pos-visible-in-window-p is essentially
free for content that fits).1 parent ff6dc1b commit d913076
1 file changed
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
551 | 554 | | |
552 | 555 | | |
553 | 556 | | |
| |||
1716 | 1719 | | |
1717 | 1720 | | |
1718 | 1721 | | |
1719 | | - | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
1720 | 1725 | | |
1721 | 1726 | | |
1722 | | - | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
1723 | 1742 | | |
1724 | 1743 | | |
1725 | 1744 | | |
| |||
1738 | 1757 | | |
1739 | 1758 | | |
1740 | 1759 | | |
| 1760 | + | |
1741 | 1761 | | |
1742 | 1762 | | |
1743 | 1763 | | |
| |||
0 commit comments