aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--window.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/window.c b/window.c
index 4a80331..e9ab2d5 100644
--- a/window.c
+++ b/window.c
@@ -301,10 +301,9 @@ void window_cursor_to(Win *win, size_t pos) {
int max_col = MIN(win->width, line->width);
while (cur < pos && col < max_col) {
cur += line->cells[col].len;
- col++;
+ /* skip over columns occupied by the same character */
+ while (++col < max_col && line->cells[col].len == 0);
}
- while (col < max_col && line->cells[col].data == '\t')
- col++;
} else {
line = win->bottomline;
row = win->height - 1;