[gnome-builder/gnome-builder-3-28] editor: reduce chances of jumping from cursor restore position
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-28] editor: reduce chances of jumping from cursor restore position
- Date: Thu, 14 Jun 2018 22:48:12 +0000 (UTC)
commit f0c58e849541b57f9543d609c88d24202dfc3539
Author: Christian Hergert <chergert redhat com>
Date: Thu Jun 14 15:46:52 2018 -0700
editor: reduce chances of jumping from cursor restore position
src/libide/editor/ide-editor-perspective.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/libide/editor/ide-editor-perspective.c b/src/libide/editor/ide-editor-perspective.c
index 486a2303a..dcf0601a5 100644
--- a/src/libide/editor/ide-editor-perspective.c
+++ b/src/libide/editor/ide-editor-perspective.c
@@ -525,7 +525,14 @@ ide_editor_perspective_focus_location_full (IdeEditorPerspective *self,
stack = gtk_widget_get_ancestor (GTK_WIDGET (lookup.view), IDE_TYPE_LAYOUT_STACK);
ide_layout_stack_set_visible_child (IDE_LAYOUT_STACK (stack), IDE_LAYOUT_VIEW (lookup.view));
- ide_editor_view_scroll_to_line_offset (lookup.view, line, line_offset);
+
+ /*
+ * Ignore 0:0 so that we don't jump from the previous cursor position,
+ * if any. It's somewhat problematic if we know we need to go to 0:0,
+ * but that is less likely.
+ */
+ if (line || line_offset)
+ ide_editor_view_scroll_to_line_offset (lookup.view, line, line_offset);
IDE_EXIT;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]