case 5: case 6: case 7: case 8:
*sub_end = '\0';
snprintf(tmp, sizeof(tmp), "%s%.*s%s"
- , Curwin->captab[ch], room, sub_beg, Caps_off);
+ , Curwin->captab[ch], utf8_embody(sub_beg, room), sub_beg, Caps_off);
rp = scat(rp, tmp);
room -= (sub_end - sub_beg);
room += utf8_delta(sub_beg);
it probably means caller wants to retain cursor position on this final
line. That, in turn, means we're interactive and so we'll just do our
'fit-to-screen' thingy while also leaving room for the cursor... */
- if (*glob) PUTT("%.*s", Screen_cols -1, glob);
+ if (*glob) PUTT("%.*s", utf8_embody(glob, Screen_cols - 1), glob);
} // end: show_special
/* For the impetus and NUMA/Node prototype design, thanks to:
Lance Shelton <LShelton@fusionio.com> - April, 2013 */
+ /* For prompting & helping with top's utf-8 support, thanks to:
+ Göran Uddeborg <goeran@uddeborg.se> - September, 2017 */
+
#ifdef PRETEND2_5_X
#define linux_version_code LINUX_VERSION(2,5,43)
#endif
. If you would like additional information regarding these strings,
. please see the prologue to the show_special function in the top.c
. source file.
+ .
+ . Caution:
+ . The next three items represent pages for interacting with a user.
+ . In all cases, the last lines of text must be treated with care.
+ .
+ . They must not end with a newline character so that at runtime the
+ . cursor will remain on that final text line.
+ .
+ . Also, the special sequences (tilde+number) must not appear on the
+ . last line (the one without the newline). So please avoid any line
+ . wraps that could place them there.
. */
Uniq_nlstab[KEYS_helpbas_fmt] = _(""