diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-02-13 12:26:57 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-02-13 13:43:13 +0100 |
| commit | 9a64a8cdd8ce6fac18e3d219dd6e3d1c76dac442 (patch) | |
| tree | bfedab9aa8f06105d65cabbfa6603fdb6bda21b4 /vis.c | |
| parent | cc7ce30fa6a2ebdb2e14d589b11520757e5a20e3 (diff) | |
| download | vis-9a64a8cdd8ce6fac18e3d219dd6e3d1c76dac442.tar.gz vis-9a64a8cdd8ce6fac18e3d219dd6e3d1c76dac442.tar.xz | |
Convert call sites of text_line_char_{get,set} to text_line_width_{get,set}
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1056,9 +1056,8 @@ void vis_insert_tab(Vis *vis) { int tabwidth = MIN(vis->tabwidth, LENGTH(spaces) - 1); for (Cursor *c = view_cursors(vis->win->view); c; c = view_cursors_next(c)) { size_t pos = view_cursors_pos(c); - /* FIXME: this does not take double width characters into account */ - int chars = text_line_char_get(vis->win->file->text, pos); - int count = tabwidth - (chars % tabwidth); + int width = text_line_width_get(vis->win->file->text, pos); + int count = tabwidth - (width % tabwidth); for (int i = 0; i < count; i++) spaces[i] = ' '; spaces[count] = '\0'; |
