[latexila] Use gtef_view_goto_line()



commit 339315f53b6ad96c6558bb73a1d0fd9b51d32a10
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Nov 18 21:07:50 2016 +0100

    Use gtef_view_goto_line()

 src/document.vala |   21 ---------------------
 src/search.vala   |    4 +---
 2 files changed, 1 insertions(+), 24 deletions(-)
---
diff --git a/src/document.vala b/src/document.vala
index b4b0e08..d332493 100644
--- a/src/document.vala
+++ b/src/document.vala
@@ -438,27 +438,6 @@ public class Document : Gtef.Buffer
         end_user_action ();
     }
 
-    // If line is bigger than the number of lines of the document, the cursor is moved
-    // to the last line and false is returned.
-    public bool goto_line (int line)
-    {
-        return_val_if_fail (line >= -1, false);
-
-        bool ret = true;
-        TextIter iter;
-
-        if (line >= get_line_count ())
-        {
-            ret = false;
-            get_end_iter (out iter);
-        }
-        else
-            get_iter_at_line (out iter, line);
-
-        place_cursor (iter);
-        return ret;
-    }
-
     public Project? get_project ()
     {
         if (project_id == -1)
diff --git a/src/search.vala b/src/search.vala
index 022fef8..5938368 100644
--- a/src/search.vala
+++ b/src/search.vala
@@ -84,12 +84,10 @@ public class GotoLine : Grid
 
         int line = int.parse (text) - 1;
 
-        if (main_window.active_document.goto_line (line))
+        if (main_window.active_view.goto_line (line))
             ErrorEntry.remove_error (entry);
         else
             ErrorEntry.add_error (entry);
-
-        main_window.active_view.scroll_to_cursor ();
     }
 }
 


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