From 9a64a8cdd8ce6fac18e3d219dd6e3d1c76dac442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 13 Feb 2016 12:26:57 +0100 Subject: Convert call sites of text_line_char_{get,set} to text_line_width_{get,set} --- vis.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'vis.c') diff --git a/vis.c b/vis.c index 1138dd7..848180f 100644 --- a/vis.c +++ b/vis.c @@ -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'; -- cgit v1.2.3