Skip to content

Commit 9f1f49b

Browse files
committed
patch 8.0.0745: multi-byte characters in a terminal don't display well
Problem: multi-byte characters in a terminal window are not displayed properly. Solution: Set the unused screen characters. (Yasuhiro Matsumoto, closes #1857)
1 parent 5a1feb8 commit 9f1f49b

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/terminal.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
* - Display the scrollback buffer (but with attributes).
4747
* Make the buffer not modifiable, drop attributes when making changes.
4848
* - when closing window and job has not ended, make terminal hidden?
49+
* - don't allow exiting Vim when a terminal is still running a job
4950
* - use win_del_lines() to make scroll-up efficient.
5051
* - command line completion for :terminal
5152
* - add test for giving error for invalid 'termsize' value.
@@ -629,9 +630,15 @@ term_update_window(win_T *wp)
629630
{
630631
#if defined(FEAT_MBYTE)
631632
if (enc_utf8 && c >= 0x80)
633+
{
634+
ScreenLines[off] = ' ';
632635
ScreenLinesUC[off] = c;
636+
}
633637
else
638+
{
634639
ScreenLines[off] = c;
640+
ScreenLinesUC[off] = NUL;
641+
}
635642
#else
636643
ScreenLines[off] = c;
637644
#endif
@@ -643,7 +650,7 @@ term_update_window(win_T *wp)
643650
++off;
644651
if (cell.width == 2)
645652
{
646-
ScreenLines[off] = ' ';
653+
ScreenLines[off] = NUL;
647654
ScreenLinesUC[off] = NUL;
648655
++pos.col;
649656
++off;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
745,
772774
/**/
773775
744,
774776
/**/

0 commit comments

Comments
 (0)