Revision: 1088 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1088&view=re... Author: frlan Date: 2009-12-23 21:33:11 +0000 (Wed, 23 Dec 2009)
Log Message: ----------- Move functionality for replacing special characters on typing into seperate code block to allow some further functiosn to be added on editor_notify event
Modified Paths: -------------- trunk/geanylatex/src/geanylatex.c
Modified: trunk/geanylatex/src/geanylatex.c =================================================================== --- trunk/geanylatex/src/geanylatex.c 2009-12-23 21:32:14 UTC (rev 1087) +++ trunk/geanylatex/src/geanylatex.c 2009-12-23 21:33:11 UTC (rev 1088) @@ -245,30 +245,30 @@ if (editor->document->file_type->id != GEANY_FILETYPES_LATEX) return FALSE; - if (toggle_active != TRUE) - return FALSE; - - if (nt->nmhdr.code == SCN_CHARADDED) + if (toggle_active == TRUE) { - gchar buf[7]; - gint len; - - len = g_unichar_to_utf8(nt->ch, buf); - if (len > 0) + if (nt->nmhdr.code == SCN_CHARADDED) { - const gchar *entity; - - buf[len] = '\0'; - entity = glatex_get_entity(buf); - - if (entity != NULL) + gchar buf[7]; + gint len; + + len = g_unichar_to_utf8(nt->ch, buf); + if (len > 0) { - gint pos = sci_get_current_position(editor->sci); - - sci_set_selection_start(editor->sci, pos - len); - sci_set_selection_end(editor->sci, pos); - - sci_replace_sel(editor->sci, entity); + const gchar *entity; + + buf[len] = '\0'; + entity = glatex_get_entity(buf); + + if (entity != NULL) + { + gint pos = sci_get_current_position(editor->sci); + + sci_set_selection_start(editor->sci, pos - len); + sci_set_selection_end(editor->sci, pos); + + sci_replace_sel(editor->sci, entity); + } } } }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org