[latexila/gnome-3] Use SourceView.get_visual_column()



commit beff1c5219842de864dbabbda9a519746d9b6fcd
Author: SÃbastien Wilmet <swilmet src gnome org>
Date:   Tue Apr 3 03:43:00 2012 +0200

    Use SourceView.get_visual_column()

 src/document_view.vala |   23 -----------------------
 src/main_window.vala   |    2 +-
 2 files changed, 1 insertions(+), 24 deletions(-)
---
diff --git a/src/document_view.vala b/src/document_view.vala
index e1d739c..67e3953 100644
--- a/src/document_view.vala
+++ b/src/document_view.vala
@@ -132,29 +132,6 @@ public class DocumentView : Gtk.SourceView
         this.buffer.select_range (start, end);
     }
 
-    // TODO when GtkSourceView 3.0 is released we can delete this function
-    public uint my_get_visual_column (TextIter iter)
-    {
-        uint column = 0;
-        uint tab_width = get_tab_width ();
-
-        TextIter position = iter;
-        position.set_visible_line_offset (0);
-
-        while (! iter.equal (position))
-        {
-            if (position.get_char () == '\t')
-                column += (tab_width - (column % tab_width));
-            else
-                column++;
-
-            if (! position.forward_char ())
-                break;
-        }
-
-        return column;
-    }
-
     public void set_font_from_settings ()
     {
         string font;
diff --git a/src/main_window.vala b/src/main_window.vala
index 3bbfc77..ce4811e 100644
--- a/src/main_window.vala
+++ b/src/main_window.vala
@@ -1062,7 +1062,7 @@ public class MainWindow : Window
         TextIter iter;
         active_document.get_iter_at_mark (out iter, active_document.get_insert ());
         int row = (int) iter.get_line ();
-        int col = (int) active_view.my_get_visual_column (iter);
+        int col = (int) active_view.get_visual_column (iter);
         statusbar.set_cursor_position (row + 1, col + 1);
     }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]