Revision: 1151 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1151&view=re... Author: frlan Date: 2010-02-09 18:45:37 +0000 (Tue, 09 Feb 2010)
Log Message: ----------- GeanyLaTeX: Move code for checking whether auto completion should be done into code block to avoid issues on unusual configuration situations
Modified Paths: -------------- trunk/geanylatex/src/geanylatex.c
Modified: trunk/geanylatex/src/geanylatex.c =================================================================== --- trunk/geanylatex/src/geanylatex.c 2010-01-31 20:59:51 UTC (rev 1150) +++ trunk/geanylatex/src/geanylatex.c 2010-02-09 18:45:37 UTC (rev 1151) @@ -396,20 +396,7 @@ gint pos;
g_return_val_if_fail(editor != NULL, FALSE); - - /* Check whether this is a LaTeX file at all. If not, we most - likely don't want to do anything. However, there is only one - exception: In case of user really wants to do so and is forcing - us with hidden preference */ - if (glatex_autocompletion_only_for_latex == TRUE && - editor->document->file_type->id != GEANY_FILETYPES_LATEX) - { - return FALSE; - } - - sci = editor->sci; - pos = sci_get_current_position(sci); - + /* Autocompletion for LaTeX specific stuff: * Introducing \end{} or \endgroup{} after a \begin{} * @@ -417,6 +404,19 @@ * where it was original developed. */ if (glatex_autocompletion_active == TRUE) { + sci = editor->sci; + pos = sci_get_current_position(sci); + + /* Check whether this is a LaTeX file at all. If not, we most + likely don't want to do anything. However, there is only one + exception: In case of user really wants to do so and is forcing + us with hidden preference */ + if (glatex_autocompletion_only_for_latex == TRUE && + editor->document->file_type->id != GEANY_FILETYPES_LATEX) + { + return FALSE; + } + if (nt->nmhdr.code == SCN_CHARADDED) { switch (nt->ch) @@ -527,7 +527,8 @@ { gchar buf[7]; gint len; - + sci = editor->sci; + len = g_unichar_to_utf8(nt->ch, buf); if (len > 0) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org