diff options
author | Peter Hofmann <scm@uninformativ.de> | 2023-10-07 07:40:39 +0200 |
---|---|---|
committer | Rafael Marçalo <raroma09@gmail.com> | 2023-10-08 23:31:59 +0100 |
commit | 088a7d71781fdeba1e8f67d4df76e37bfa6fe6dd (patch) | |
tree | 3d737cbe8402000c8bbb0022106ae1601f861b78 | |
parent | 9f15a1c4913cb42c8ee1ba0d83175ee295f4eae4 (diff) |
Fix wide glyphs breaking "nowrap" mode
Consider the following example:
printf '\e[?7l';\
for i in $(seq $(($(tput cols) - 1))); do printf a; done;\
printf 'đŸ™ˆ\n';\
printf '\e[?7h'
Even though MODE_WRAP has been disabled, the emoji appeared on the next
line. This patch keeps wide glyphs on the same line and moves them to
the right-most possible position.
-rw-r--r-- | st.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -2565,7 +2565,10 @@ check_control_code: } if (term.c.x+width > term.col) { - tnewline(1); + if (IS_SET(MODE_WRAP)) + tnewline(1); + else + tmoveto(term.col - width, term.c.y); gp = &term.line[term.c.y][term.c.x]; } |