From c424e2e7abc2a473cdc01786791c2c4240624a29 Mon Sep 17 00:00:00 2001 From: Alan Date: Wed, 20 Mar 2024 10:51:47 +0800 Subject: [PATCH] src/Builder4/Editor.bjs src/Builder4/Editor.vala --- src/Builder4/Editor.bjs | 6 ++++++ src/Builder4/Editor.vala | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/Builder4/Editor.bjs b/src/Builder4/Editor.bjs index 1f85ab6ca..0af5410e0 100644 --- a/src/Builder4/Editor.bjs +++ b/src/Builder4/Editor.bjs @@ -1172,6 +1172,12 @@ " */", " GLib.debug(\"goto line %d\", (int)sym.range.start.line); ", " _this.scroll_to_line((int)sym.range.start.line);", + " Gtk.TextIter iter;", + " _this.buffer.el.get_iter_at_line_offset(out iter, ", + " \tsym.range.start.line,", + " \tsym.range.start.character", + "\t)", + " _this.buffer.el.place_cursor(iter);", "\t", "}" ] diff --git a/src/Builder4/Editor.vala b/src/Builder4/Editor.vala index f5b29f471..7652ac9f6 100644 --- a/src/Builder4/Editor.vala +++ b/src/Builder4/Editor.vala @@ -2309,6 +2309,12 @@ public class Editor : Object */ GLib.debug("goto line %d", (int)sym.range.start.line); _this.scroll_to_line((int)sym.range.start.line); + Gtk.TextIter iter; + _this.buffer.el.get_iter_at_line_offset(out iter, + sym.range.start.line, + sym.range.start.character + ) + _this.buffer.el.place_cursor(iter); }); } -- 2.39.2