Revision: 5353 http://geany.svn.sourceforge.net/geany/?rev=5353&view=rev Author: ntrel Date: 2010-11-02 12:57:10 +0000 (Tue, 02 Nov 2010)
Log Message: ----------- Only automatically replace characters when the current document is a Markup document.
Modified Paths: -------------- trunk/ChangeLog trunk/plugins/htmlchars.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-11-02 12:55:17 UTC (rev 5352) +++ trunk/ChangeLog 2010-11-02 12:57:10 UTC (rev 5353) @@ -2,6 +2,9 @@
* src/plugindata.h, src/plugins.c, plugins/geanyfunctions.h: Add sci_get_lexer() to plugin API. + * plugins/htmlchars.c: + Only automatically replace characters when the current document is + a Markup document.
2010-11-01 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/plugins/htmlchars.c =================================================================== --- trunk/plugins/htmlchars.c 2010-11-02 12:55:17 UTC (rev 5352) +++ trunk/plugins/htmlchars.c 2010-11-02 12:57:10 UTC (rev 5353) @@ -27,6 +27,7 @@
#include "geanyplugin.h" #include <string.h> +#include "SciLexer.h"
GeanyData *geany_data; @@ -376,7 +377,7 @@ g_free(config_dir); g_key_file_free(config); } -} +}
static void toggle_status(G_GNUC_UNUSED GtkMenuItem * menuitem) @@ -422,11 +423,17 @@ static gboolean ht_editor_notify_cb(GObject *object, GeanyEditor *editor, SCNotification *nt, gpointer data) { + gint lexer; + g_return_val_if_fail(editor != NULL, FALSE);
- if (plugin_active != TRUE) + if (!plugin_active) return FALSE;
+ lexer = sci_get_lexer(editor->sci); + if (lexer != SCLEX_HTML && lexer != SCLEX_XML) + return FALSE; + if (nt->nmhdr.code == SCN_CHARADDED) { gchar buf[7];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.