dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit 6be3fcdae77eefc7f8c87f3ebfb1be2fce334480
parent 9bf8f4723955d644bdbb2b7597bee5c0db776325
Author: Marc Andre Tanner <mat@brain-dump.org>
Date:   Tue, 12 Feb 2013 09:44:18 +0100

vt: always redraw whole line if dirty

Previously the end of lines with certain multibyte characters
would not get repainted which resulted in artifacts when selecting
text in copymode.

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>

Diffstat:
vt.c | 17+++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/vt.c b/vt.c @@ -1459,14 +1459,23 @@ void vt_draw(Vt *t, WINDOW * win, int srow, int scol) if (is_utf8 && cell->text >= 128) { char buf[MB_CUR_MAX + 1]; - int len = wcrtomb(buf, cell->text, NULL); - waddnstr(win, buf, len); - if (wcwidth(cell->text) > 1) - j++; + size_t len = wcrtomb(buf, cell->text, NULL); + if (len > 0) { + waddnstr(win, buf, len); + if (wcwidth(cell->text) > 1) + j++; + } } else { waddch(win, cell->text > ' ' ? cell->text : ' '); } } + + int x, y; + getyx(win, y, x); + (void)y; + if (x && x < b->cols - 1) + whline(win, ' ', b->cols - x); + row->dirty = false; }