From ae6c3801292c0279a6263ce2b363d0719a0737da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 11 Mar 2018 23:34:26 +0100 Subject: view: properly advance over incomplete unicode sequence When fetching more text we have to skip the bytes processed by the previous cell, otherwise we end up in an infinite loop. --- view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'view.c') diff --git a/view.c b/view.c index 773f3a7..71f9fe6 100644 --- a/view.c +++ b/view.c @@ -360,7 +360,7 @@ void view_draw(View *view) { * wide character. advance file position and read * another junk into buffer. */ - rem = text_bytes_get(view->text, pos, size, text); + rem = text_bytes_get(view->text, pos+prev_cell.len, size, text); text[rem] = '\0'; cur = text; continue; -- cgit v1.2.3