diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-09-11 17:54:55 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-09-11 17:54:55 +0200 |
| commit | ae450167e7f0574876db44bbe434c4021ee02979 (patch) | |
| tree | b1c8c62506473841667ef5a2485eb07092f00cf1 /window.c | |
| parent | 6c5bdddbb5e7f79a04a0ee2bd7a9252035151812 (diff) | |
| download | vis-ae450167e7f0574876db44bbe434c4021ee02979.tar.gz vis-ae450167e7f0574876db44bbe434c4021ee02979.tar.xz | |
Fix bug when moving to characters with display width > 1
Diffstat (limited to 'window.c')
| -rw-r--r-- | window.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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; |
