Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Sun, 25 Oct 2020 09:50:08 UTC Commit: ca2c904e47295b54f57555849695801c670a23b3 https://github.com/geany/geany/commit/ca2c904e47295b54f57555849695801c670a23...
Log Message: ----------- Recalculate margins size when changing font
Modified Paths: -------------- src/editor.c
Modified: src/editor.c 15 lines changed, 11 insertions(+), 4 deletions(-) =================================================================== @@ -1065,6 +1065,15 @@ void editor_sci_notify_cb(G_GNUC_UNUSED GtkWidget *widget, G_GNUC_UNUSED gint sc }
+/* recalculate margins width */ +static void update_margins(ScintillaObject *sci) +{ + sci_set_line_numbers(sci, editor_prefs.show_linenumber_margin); + sci_set_symbol_margin(sci, editor_prefs.show_markers_margin); + sci_set_folding_margin_visible(sci, editor_prefs.folding); +} + + static gboolean on_editor_notify(G_GNUC_UNUSED GObject *object, GeanyEditor *editor, SCNotification *nt, G_GNUC_UNUSED gpointer data) { @@ -1185,10 +1194,7 @@ static gboolean on_editor_notify(G_GNUC_UNUSED GObject *object, GeanyEditor *edi break;
case SCN_ZOOM: - /* recalculate line margin width */ - sci_set_line_numbers(sci, editor_prefs.show_linenumber_margin); - sci_set_symbol_margin(sci, editor_prefs.show_markers_margin); - sci_set_folding_margin_visible(sci, editor_prefs.folding); + update_margins(sci); break; } /* we always return FALSE here to let plugins handle the event too */ @@ -4610,6 +4616,7 @@ void editor_set_font(GeanyEditor *editor, const gchar *font)
g_free(font_name);
+ update_margins(editor->sci); /* zoom to 100% to prevent confusion */ sci_zoom_off(editor->sci); }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).