[gnome-builder] todo: scroll to line of todo item



commit 45b46b382bb5f4d241084620fcbe9dbca42762c4
Author: Ben Iofel <iofelben gmail com>
Date:   Fri Mar 18 12:40:18 2016 -0400

    todo: scroll to line of todo item
    
    This isn't perfect because we don't have all the line info immediately
    after loading. However, the cursor gets placed correctly

 libide/editor/ide-editor-workbench-addin.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/libide/editor/ide-editor-workbench-addin.c b/libide/editor/ide-editor-workbench-addin.c
index f11b5fb..e394322 100644
--- a/libide/editor/ide-editor-workbench-addin.c
+++ b/libide/editor/ide-editor-workbench-addin.c
@@ -173,11 +173,10 @@ ide_editor_workbench_addin_open_cb (GObject      *object,
 
       if (sscanf (fragment, "L%u_%u", &line, &column) >= 1)
         {
-          GtkTextIter iter;
+          g_autoptr(IdeSourceLocation) location = NULL;
 
-          /* Reminder this is only safe on 3.20 */
-          gtk_text_buffer_get_iter_at_line_offset (GTK_TEXT_BUFFER (buffer), &iter, line, column);
-          gtk_text_buffer_select_range (GTK_TEXT_BUFFER (buffer), &iter, &iter);
+          location = ide_source_location_new (ide_buffer_get_file (buffer), line, column, 0);
+          ide_editor_perspective_focus_location (self->perspective, location);
         }
     }
 


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