Revision: 1247 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1247&view=re... Author: frlan Date: 2010-04-16 17:34:07 +0000 (Fri, 16 Apr 2010)
Log Message: ----------- GeanyLaTeX: Fix indention on insert environment features.
Modified Paths: -------------- trunk/geanylatex/ChangeLog trunk/geanylatex/TODO trunk/geanylatex/src/latexenvironments.c trunk/geanylatex/src/latexutils.c
Modified: trunk/geanylatex/ChangeLog =================================================================== --- trunk/geanylatex/ChangeLog 2010-04-16 17:33:39 UTC (rev 1246) +++ trunk/geanylatex/ChangeLog 2010-04-16 17:34:07 UTC (rev 1247) @@ -1,3 +1,8 @@ +2010-04-16 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + + * Fix indention on insert environment features. + + 2010-04-14 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
* Ensure basic indent is getting applied on closing command of
Modified: trunk/geanylatex/TODO =================================================================== --- trunk/geanylatex/TODO 2010-04-16 17:33:39 UTC (rev 1246) +++ trunk/geanylatex/TODO 2010-04-16 17:34:07 UTC (rev 1247) @@ -1,8 +1,6 @@ TODO ************ Bugs & Problems: -* Improve handling of indention on - * Inserting an list environment * Closing dialogs via hitting return
Features:
Modified: trunk/geanylatex/src/latexenvironments.c =================================================================== --- trunk/geanylatex/src/latexenvironments.c 2010-04-16 17:33:39 UTC (rev 1246) +++ trunk/geanylatex/src/latexenvironments.c 2010-04-16 17:34:07 UTC (rev 1247) @@ -98,6 +98,7 @@ gchar *tmp = NULL;
sci_start_undo_action(doc->editor->sci); + tmpstring = g_string_new("\begin{"); g_string_append(tmpstring, environment);
@@ -109,22 +110,23 @@ { g_string_append(tmpstring, "}"); } - g_string_append(tmpstring, "\n"); + g_string_append(tmpstring, "\n\t");
+ if (type == GLATEX_ENVIRONMENT_TYPE_LIST) { - g_string_append(tmpstring, "\t\item\n"); + g_string_append(tmpstring, "\item "); }
- g_string_append(tmpstring, "\end{"); - g_string_append(tmpstring, environment); - g_string_append(tmpstring,"}\n"); + tmp = g_string_free(tmpstring, FALSE); + glatex_insert_string(tmp, TRUE); + g_free(tmp);
- tmp = g_string_free(tmpstring, FALSE); + tmp = g_strdup_printf("\n\end{%s}\n", environment); glatex_insert_string(tmp, FALSE); - sci_set_current_position(doc->editor->sci, pos + len + 9, TRUE); + g_free(tmp); + sci_end_undo_action(doc->editor->sci); - g_free(tmp); } } }
Modified: trunk/geanylatex/src/latexutils.c =================================================================== --- trunk/geanylatex/src/latexutils.c 2010-04-16 17:33:39 UTC (rev 1246) +++ trunk/geanylatex/src/latexutils.c 2010-04-16 17:34:07 UTC (rev 1247) @@ -115,6 +115,6 @@ len = strlen(string); }
- editor_insert_text_block(doc->editor, string, pos, len, -1, TRUE); + editor_insert_text_block(doc->editor, string, pos, len, 0, TRUE); } }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.