Revision: 5654 http://geany.svn.sourceforge.net/geany/?rev=5654&view=rev Author: ntrel Date: 2011-03-30 12:31:29 +0000 (Wed, 30 Mar 2011)
Log Message: ----------- Update styles when the filetype changes (based on patch by Matthew Brush, thanks).
Modified Paths: -------------- trunk/ChangeLog trunk/plugins/splitwindow.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-03-30 12:20:18 UTC (rev 5653) +++ trunk/ChangeLog 2011-03-30 12:31:29 UTC (rev 5654) @@ -4,6 +4,9 @@ Use STYLE_MAX instead of 127 for editor_set_font(). This fixes a crash in the Split Window plugin when changing filetype (patch by Matthew Brush, thanks; fixes #3255968). + * plugins/splitwindow.c: + Update styles when the filetype changes (based on patch by + Matthew Brush, thanks).
2011-03-30 Colomban Wendling <colomban(at)geany(dot)org>
Modified: trunk/plugins/splitwindow.c =================================================================== --- trunk/plugins/splitwindow.c 2011-03-30 12:20:18 UTC (rev 5653) +++ trunk/plugins/splitwindow.c 2011-03-30 12:31:29 UTC (rev 5654) @@ -474,11 +474,21 @@ }
+static void on_document_filetype_set(GObject *obj, GeanyDocument *doc, + GeanyFiletype *filetype_old, gpointer user_data) +{ + /* update styles */ + if (edit_window.editor == doc->editor) + sync_to_current(edit_window.sci, doc->editor->sci); +} + + PluginCallback plugin_callbacks[] = { - { "document-close", (GCallback) &on_document_close, FALSE, NULL }, - { "document-save", (GCallback) &on_document_save, FALSE, NULL }, - { NULL, NULL, FALSE, NULL } + { "document-close", (GCallback) &on_document_close, FALSE, NULL }, + { "document-save", (GCallback) &on_document_save, FALSE, NULL }, + { "document-filetype-set", (GCallback) &on_document_filetype_set, FALSE, NULL }, + { NULL, NULL, FALSE, NULL } };
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.