summaryrefslogtreecommitdiffhomepage
path: root/include/stc/csview.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/stc/csview.h')
-rw-r--r--include/stc/csview.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/stc/csview.h b/include/stc/csview.h
index 2e90c69b..3bb8a542 100644
--- a/include/stc/csview.h
+++ b/include/stc/csview.h
@@ -91,6 +91,7 @@ STC_INLINE csview_iter csview_advance(csview_iter it, isize_t pos) {
if (pos > 0) pos = -pos, inc = 1;
while (pos && it.ref != it.u8.end) pos += (*(it.ref += inc) & 0xC0) != 0x80;
it.u8.chr.size = utf8_chr_size(it.ref);
+ if (it.ref == it.u8.end) it.ref = NULL;
return it;
}