From 67248807aa0ffd4f067274cd5c49ecb62fcf55ec Mon Sep 17 00:00:00 2001 From: WrapEarnPass <293701378+WrapEarnPass@users.noreply.github.com> Date: Fri, 31 Jul 2026 06:52:52 -0400 Subject: [PATCH 1/2] Fix delete markers on release --- git-changebar/src/gcb-plugin.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git-changebar/src/gcb-plugin.c b/git-changebar/src/gcb-plugin.c index 8704fefec5..48ae98efcc 100644 --- a/git-changebar/src/gcb-plugin.c +++ b/git-changebar/src/gcb-plugin.c @@ -648,6 +648,8 @@ release_resources (ScintillaObject *sci) for (j = 0; j < MARKER_COUNT; j++) { if (G_markers[j].num >= 0) { + scintilla_send_message (sci, SCI_MARKERDELETEALL, + G_markers[j].num, 0); scintilla_send_message (sci, SCI_MARKERDEFINE, G_markers[j].num, SC_MARK_AVAILABLE); } From f9ff00e6bceaf1cea6e77b6e1bf6fdffea0f64dd Mon Sep 17 00:00:00 2001 From: WrapEarnPass <293701378+WrapEarnPass@users.noreply.github.com> Date: Fri, 31 Jul 2026 10:34:04 -0400 Subject: [PATCH 2/2] Add system color option Add ui element for system color Add handler for system color Add editor-notify abuse to ensure colors are set if system color is true --- git-changebar/data/prefs.ui | 21 +++++++++++++++++++-- git-changebar/src/gcb-plugin.c | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/git-changebar/data/prefs.ui b/git-changebar/data/prefs.ui index cce7663af0..abf31c46e8 100644 --- a/git-changebar/data/prefs.ui +++ b/git-changebar/data/prefs.ui @@ -5,7 +5,7 @@ True False - 6 + 7 _Monitor repository for changes @@ -23,6 +23,23 @@ 0 + + + _Use System Colors + True + True + False + Use colors set in colorscheme for line_added, line_removed, line_changed + True + 0 + True + + + False + True + 1 + + True @@ -173,7 +190,7 @@ True True - 1 + 2 diff --git a/git-changebar/src/gcb-plugin.c b/git-changebar/src/gcb-plugin.c index 48ae98efcc..7917643c2b 100644 --- a/git-changebar/src/gcb-plugin.c +++ b/git-changebar/src/gcb-plugin.c @@ -31,6 +31,7 @@ #include #include #include +#include #ifdef LIBGIT2_VER_MINOR # define CHECK_LIBGIT2_VERSION(MAJOR, MINOR) \ @@ -187,6 +188,7 @@ static GAsyncQueue *G_queue = NULL; static GThread *G_thread = NULL; static gulong G_source_id = 0; static gboolean G_monitoring_enabled = TRUE; +static gboolean G_system_colors = TRUE; static GtkWidget *G_undo_menu_item = NULL; static struct { gint num; @@ -213,6 +215,8 @@ static const struct { } G_settings_desc[] = { { "general", "monitor-repository", &G_monitoring_enabled, read_setting_boolean, write_setting_boolean }, + { "general", "system-colors", &G_system_colors, + read_setting_boolean, write_setting_boolean }, { "colors", "line-added", &G_markers[MARKER_LINE_ADDED].color, read_setting_color, write_setting_color }, { "colors", "line-changed", &G_markers[MARKER_LINE_CHANGED].color, @@ -1067,6 +1071,16 @@ on_editor_notify (GObject *obj, SCNotification *nt, gpointer user_data) { + /*geany doesnt emit a signal on colorscheme change*/ + if(G_system_colors){ + const GeanyLexerStyle * diffadd_style = highlighting_get_style ( GEANY_FILETYPES_DIFF, SCE_DIFF_ADDED); + scintilla_send_message (editor->sci, SCI_MARKERSETBACK, G_markers[MARKER_LINE_ADDED].num, diffadd_style->foreground); + const GeanyLexerStyle * diffchg_style = highlighting_get_style ( GEANY_FILETYPES_DIFF, SCE_DIFF_CHANGED); + scintilla_send_message (editor->sci, SCI_MARKERSETBACK, G_markers[MARKER_LINE_CHANGED].num, diffchg_style->foreground); + const GeanyLexerStyle * diffdel_style = highlighting_get_style ( GEANY_FILETYPES_DIFF, SCE_DIFF_DELETED); + scintilla_send_message (editor->sci, SCI_MARKERSETBACK, G_markers[MARKER_LINE_REMOVED].num, diffdel_style->foreground); + } + if (nt->nmhdr.code == SCN_CHARADDED || (nt->nmhdr.code == SCN_MODIFIED && nt->modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT))) { @@ -1615,6 +1629,7 @@ typedef struct ConfigureWidgets ConfigureWidgets; struct ConfigureWidgets { GtkWidget *base; GtkWidget *monitoring_check; + GtkWidget *system_colors; GtkWidget *added_color_button; GtkWidget *changed_color_button; GtkWidget *removed_color_button; @@ -1656,6 +1671,7 @@ on_plugin_configure_response (GtkDialog *dialog, GeanyDocument *doc = document_get_current (); G_monitoring_enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cw->monitoring_check)); + G_system_colors = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cw->system_colors)); gtk_color_button_get_color (GTK_COLOR_BUTTON (cw->added_color_button), &color); G_markers[MARKER_LINE_ADDED].color = color_to_int (&color); @@ -1717,6 +1733,7 @@ plugin_configure (GtkDialog *dialog) } map[] = { { "base", &cw->base }, { "monitoring-check", &cw->monitoring_check }, + { "system-colors", &cw->system_colors }, { "added-color-button", &cw->added_color_button }, { "changed-color-button", &cw->changed_color_button }, { "removed-color-button", &cw->removed_color_button }, @@ -1729,6 +1746,8 @@ plugin_configure (GtkDialog *dialog) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cw->monitoring_check), G_monitoring_enabled); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cw->system_colors), + G_system_colors); color_from_int (&color, G_markers[MARKER_LINE_ADDED].color); gtk_color_button_set_color (GTK_COLOR_BUTTON (cw->added_color_button), &color);