aboutsummaryrefslogtreecommitdiff
path: root/view.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2018-03-11 23:34:26 +0100
committerMarc André Tanner <mat@brain-dump.org>2018-03-11 23:34:26 +0100
commitae6c3801292c0279a6263ce2b363d0719a0737da (patch)
tree50a5a97c6e1a1e2aaabc19eeacee9a6d9082bdff /view.c
parentd0efde07da335310b2e9da3bb9a690c2123fbc5e (diff)
downloadvis-ae6c3801292c0279a6263ce2b363d0719a0737da.tar.gz
vis-ae6c3801292c0279a6263ce2b363d0719a0737da.tar.xz
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.
Diffstat (limited to 'view.c')
-rw-r--r--view.c2
1 files changed, 1 insertions, 1 deletions
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;