Skip to content

Commit

Permalink
git-changebar: Re-set first visible line after Scintilla size request
Browse files Browse the repository at this point in the history
After updating to Scintilla 5.3.7 the Scintilla popup with the diff
against git shows the wrong number.

It seems that gtk_widget_set_size_request() scrolls Scintilla view so
despite it was set previously, it isn't set correctly after this call
and has to be re-set.

Note that the call to SCI_SETFIRSTVISIBLELINE has to stay at the original
location too, otherwise subsequent calculation using SCI_POINTXFROMPOSITION
doesn't work because the line may not be visible.
  • Loading branch information
techee committed Oct 13, 2023
1 parent f2e4200 commit 9ad218b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions git-changebar/src/gcb-plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,9 @@ get_widget_for_buf_range (GeanyDocument *doc,
MIN (width + 2, alloc.width),
MIN (height + 1, alloc.height));

/* Size request seems to scroll Scintilla view so we have to re-set visible lines again */
scintilla_send_message (sci, SCI_SETFIRSTVISIBLELINE, line_start, 0);

return GTK_WIDGET (sci);
}

Expand Down

0 comments on commit 9ad218b

Please sign in to comment.