Skip to content

Commit

Permalink
Merge branch 'master' into colinkiama/add-actions-to-file-view
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Jul 2, 2024
2 parents 24a5d4a + 256d0bc commit 272377f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Widgets/SourceView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ namespace Scratch.Widgets {
public void go_to_line (int line, int offset = 0) {
Gtk.TextIter it;
buffer.get_iter_at_line (out it, line - 1);
it.forward_chars (offset);
// Ensures offset is set to start of line when column is not set
// offset = column - 1
it.forward_chars (offset == -1 ? 0 : offset);
scroll_to_iter (it, 0, false, 0, 0);
buffer.place_cursor (it);
}
Expand Down

0 comments on commit 272377f

Please sign in to comment.