Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Widgets/FormatBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ public class Code.FormatBar : Gtk.Box {
buffer.get_iter_at_offset (out iter, position);
var line = iter.get_line () + 1;

line_menubutton.text = "%d.%d".printf (line, iter.get_line_offset ());
goto_entry.text = "%d.%d".printf (line, iter.get_line_offset ());
line_menubutton.text = "%d.%d".printf (line, iter.get_line_offset () + 1);
goto_entry.text = "%d.%d".printf (line, iter.get_line_offset () + 1);
}

private void create_line_popover () {
Expand All @@ -235,12 +235,12 @@ public class Code.FormatBar : Gtk.Box {

// We need to connect_after because otherwise, the text isn't parsed into the "value" property and we only get the previous value
goto_entry.activate.connect_after (() => {
int line, offset;
int line, column;

goto_entry.text = goto_entry.text.replace (":", ".");

goto_entry.text.scanf ("%i.%i", out line, out offset);
doc.source_view.go_to_line (line, offset);
goto_entry.text.scanf ("%i.%i", out line, out column);
doc.source_view.go_to_line (line, column - 1);
// Focuses parent to the source view, so that the cursor, which indicates line and column is actually visible.
doc.source_view.grab_focus ();
});
Expand Down