Skip to content

Commit 1ff25c8

Browse files
committed
fix scroll_cursor_into_view by using runes() to calculate line length
1 parent a0b96e0 commit 1ff25c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

view_text.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ fn scroll_cursor_into_view(cursor_pos int, layout &Layout, _ &Event, mut w Windo
214214
mut total_len := 0
215215
for i, line in layout.shape.text_lines {
216216
line_idx = i
217-
total_len += line.len
217+
total_len += line.runes().len
218218
if total_len > cursor_pos {
219219
break
220220
}

0 commit comments

Comments
 (0)