diff options
author | oni-link <knil.ino@gmail.com> | 2014-05-22 16:39:21 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-06-20 02:38:29 -0400 |
commit | 4ccf1125ff569eccfc34abc4ad794044c5ab7455 (patch) | |
tree | 0e38e99432805bbfd1a0e20f2022f1d4cf1f1bde /src/nvim/screen.c | |
parent | c3887379577f95b0621fc47b0d0a3423079b7b03 (diff) | |
download | rneovim-4ccf1125ff569eccfc34abc4ad794044c5ab7455.tar.gz rneovim-4ccf1125ff569eccfc34abc4ad794044c5ab7455.tar.bz2 rneovim-4ccf1125ff569eccfc34abc4ad794044c5ab7455.zip |
vim-patch:7.4.303 #818
Problem: When using double-width characters the text displayed on the
command line is sometimes truncated.
Solution: Reset the string lenght. (Nobuhiro Takasaki)
https://code.google.com/p/vim/source/detail?r=463ef551e9f62b63ac3f85f1f297b668b14bcd09
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 88e1c2dd6d..54dcaff39e 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -5215,10 +5215,11 @@ void screen_puts(char_u *text, int row, int col, int attr) * Like screen_puts(), but output "text[len]". When "len" is -1 output up to * a NUL. */ -void screen_puts_len(char_u *text, int len, int row, int col, int attr) +void screen_puts_len(char_u *text, int textlen, int row, int col, int attr) { unsigned off; char_u *ptr = text; + int len = textlen; int c; unsigned max_off; int mbyte_blen = 1; @@ -5404,8 +5405,11 @@ void screen_puts_len(char_u *text, int len, int row, int col, int attr) off += mbyte_cells; col += mbyte_cells; ptr += mbyte_blen; - if (clear_next_cell) + if (clear_next_cell) { + // This only happens at the end, display one space next. ptr = (char_u *)" "; + len = -1; + } } else { ++off; ++col; |