diff options
author | mbkma <[email protected]> | 2020-09-30 20:07:48 +0200 |
---|---|---|
committer | Robert Antoni Buj Gelonch <[email protected]> | 2020-10-04 14:49:10 +0200 |
commit | f913bec5ae676697efc616f3127eefb2de7c0467 (patch) | |
tree | 851d9cd1693bd6a3230f5c6ab3d80d302f800492 | |
parent | 913abaa7db6809178b17aa019013ddbf02289791 (diff) | |
download | pluma-f913bec5ae676697efc616f3127eefb2de7c0467.tar.bz2 pluma-f913bec5ae676697efc616f3127eefb2de7c0467.tar.xz |
Use gtk_source_view_get_visual_column
-rw-r--r-- | pluma/pluma-window.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/pluma/pluma-window.c b/pluma/pluma-window.c index 17da00e8..5ae05676 100644 --- a/pluma/pluma-window.c +++ b/pluma/pluma-window.c @@ -2140,8 +2140,6 @@ update_cursor_position_statusbar (GtkTextBuffer *buffer, { gint row, col; GtkTextIter iter; - GtkTextIter start; - guint tab_size; PlumaView *view; pluma_debug (DEBUG_WINDOW); @@ -2157,23 +2155,7 @@ update_cursor_position_statusbar (GtkTextBuffer *buffer, row = gtk_text_iter_get_line (&iter); - start = iter; - gtk_text_iter_set_line_offset (&start, 0); - col = 0; - - tab_size = gtk_source_view_get_tab_width (GTK_SOURCE_VIEW (view)); - - while (!gtk_text_iter_equal (&start, &iter)) - { - /* FIXME: Are we Unicode compliant here? */ - if (gtk_text_iter_get_char (&start) == '\t') - - col += (tab_size - (col % tab_size)); - else - ++col; - - gtk_text_iter_forward_char (&start); - } + col = gtk_source_view_get_visual_column (GTK_SOURCE_VIEW(view), &iter); pluma_statusbar_set_cursor_position ( PLUMA_STATUSBAR (window->priv->statusbar), |