[gedit/wip/text-cut-off-3] goto start buffer only, without scrolling
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/wip/text-cut-off-3] goto start buffer only, without scrolling
- Date: Thu, 21 Jul 2022 20:37:14 +0000 (UTC)
commit 73e5bc36e9c34e30f45991240e12e41399cf72c6
Author: Sébastien Wilmet <swilmet informatique-libre be>
Date: Thu Jul 21 22:33:47 2022 +0200
goto start buffer only, without scrolling
gedit/gedit-tab.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/gedit/gedit-tab.c b/gedit/gedit-tab.c
index 79e9a4465..6de433120 100644
--- a/gedit/gedit-tab.c
+++ b/gedit/gedit-tab.c
@@ -1627,6 +1627,14 @@ loader_progress_cb (goffset size,
static void
goto_line (GTask *loading_task)
{
+ LoaderData *data = g_task_get_task_data (loading_task);
+ GeditDocument *doc = gedit_tab_get_document (data->tab);
+ GtkTextIter iter;
+
+ gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER (doc), &iter);
+ gtk_text_buffer_place_cursor (GTK_TEXT_BUFFER (doc), &iter);
+
+#if 0
LoaderData *data = g_task_get_task_data (loading_task);
GeditDocument *doc = gedit_tab_get_document (data->tab);
gboolean check_is_cursor_position = FALSE;
@@ -1694,6 +1702,7 @@ goto_line (GTask *loading_task)
g_print ("install idle scroll\n");
data->tab->idle_scroll = g_idle_add ((GSourceFunc)scroll_to_cursor, data->tab);
}
+#endif
}
static gboolean
@@ -1756,7 +1765,7 @@ successful_load (GTask *loading_task)
NULL);
}
- //goto_line (loading_task);
+ goto_line (loading_task);
location = gtk_source_file_loader_get_location (data->loader);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]