From 9ad218bcdd6f57550bbcc2932c01bc71d89f2316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= Date: Thu, 12 Oct 2023 17:03:00 +0200 Subject: [PATCH] git-changebar: Re-set first visible line after Scintilla size request 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. --- git-changebar/src/gcb-plugin.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git-changebar/src/gcb-plugin.c b/git-changebar/src/gcb-plugin.c index dd2f9c19f..3d5608004 100644 --- a/git-changebar/src/gcb-plugin.c +++ b/git-changebar/src/gcb-plugin.c @@ -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); }