Skip to content

Commit

Permalink
avoid scrolling artefacts at overhanging emojis:
Browse files Browse the repository at this point in the history
mark emoji overhang in subsequent character position
not only if that is a space but also with setting EmojiPlacement=full (#1261);
drop exemptions (for numbers and flag letters) from emoji space expansion (#1104, 3.5.1)
  • Loading branch information
mintty committed Apr 19, 2024
1 parent 9374a3a commit 2fc08df
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/term.c
Original file line number Diff line number Diff line change
Expand Up @@ -3181,15 +3181,22 @@ term_paint(void)
// only if followed by space
//&& iswspace(d[1].chr) && !d[1].cc_next
//&& d[1].chr != 0x1680 && d[1].chr != 0x3000
&& d[1].chr == ' ' && !d[1].cc_next
&& ((d[1].chr == ' ' && !d[1].cc_next)
// ... or with setting EmojiPlacement=full,
// to avoid scrolling artefacts (#1261)
|| cfg.emoji_placement == EMPL_FULL
)
// not at cursor position? does not work for emojis
//&& !at_cursor_pos(i, j)
// and significant attributes are equal
&& !((d->attr.attr ^ d[1].attr.attr) & ~IGNOVRHANG)
// do not overhang numbers, flag letters etc
#ifdef exempt_emoji_components_from_overhang
#warning drop this for #1261
// do not overhang numbers, flag letters etc (~#1104)
&& d->chr >= 0x80 // exclude #️*️0️..9️
//&& !(ch >= 0x1F1E6 || ch <= 0x1F1FF) // exclude 🇦..🇿
&& !(!e.seq && emoji_bases[e.idx].ch >= 0x1F1E6 && emoji_bases[e.idx].ch <= 0x1F1FF)
#endif
)
{
d->attr.attr |= TATTR_OVERHANG;
Expand Down Expand Up @@ -3430,15 +3437,22 @@ term_paint(void)
// only if followed by space
//&& iswspace(d[1].chr) && !d[1].cc_next
//&& d[1].chr != 0x1680 && d[1].chr != 0x3000
&& d[1].chr == ' ' && !d[1].cc_next
&& ((d[1].chr == ' ' && !d[1].cc_next)
// ... or with setting EmojiPlacement=full,
// to avoid scrolling artefacts (#1261)
|| cfg.emoji_placement == EMPL_FULL
)
// not at cursor position? does not work for emojis
//&& !at_cursor_pos(i, j)
// and significant attributes are equal
&& !((d->attr.attr ^ d[1].attr.attr) & ~IGNOVRHANG)
// do not overhang numbers, flag letters etc
#ifdef exempt_emoji_components_from_overhang
#warning drop this for #1261
// do not overhang numbers, flag letters etc (~#1104)
&& d->chr >= 0x80 // exclude #️*️0️..9️
//&& !(ch >= 0x1F1E6 || ch <= 0x1F1FF) // exclude 🇦..🇿
&& !(!e.seq && emoji_bases[e.idx].ch >= 0x1F1E6 && emoji_bases[e.idx].ch <= 0x1F1FF)
#endif
)
{
d->attr.attr |= TATTR_OVERHANG;
Expand Down
2 changes: 2 additions & 0 deletions wiki/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Terminal features
* Restore wrap modes on return from VT52 mode.
* Fix scrolling artefacts at overhanging emojis with setting EmojiPlacement=full (#1261).
* Drop exemptions from emoji space expansion (numbers and flag letters, ~#1104).

### 3.7.1 (24 February 2024) ###

Expand Down

0 comments on commit 2fc08df

Please sign in to comment.