Revision: 1341 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1341&view=re... Author: frlan Date: 2010-05-10 22:07:37 +0000 (Mon, 10 May 2010)
Log Message: ----------- GeanyLaTeX: Fix indention on inserting list environments.
Modified Paths: -------------- trunk/geanylatex/ChangeLog trunk/geanylatex/src/latexenvironments.c
Modified: trunk/geanylatex/ChangeLog =================================================================== --- trunk/geanylatex/ChangeLog 2010-05-10 21:29:47 UTC (rev 1340) +++ trunk/geanylatex/ChangeLog 2010-05-10 22:07:37 UTC (rev 1341) @@ -1,3 +1,8 @@ +2010-05-10 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + + * Fix indention on inserting list environments. + + 2010-04-24 Frank Lanitz frank@frank.uvena.de
* Add a simple insert dommand dialog, which shall support inserting
Modified: trunk/geanylatex/src/latexenvironments.c =================================================================== --- trunk/geanylatex/src/latexenvironments.c 2010-05-10 21:29:47 UTC (rev 1340) +++ trunk/geanylatex/src/latexenvironments.c 2010-05-10 22:07:37 UTC (rev 1341) @@ -95,10 +95,11 @@ gint indent, pos, len; GString *tmpstring = NULL; gchar *tmp = NULL; + const GeanyIndentPrefs *prefs = NULL;
pos = sci_get_current_position(doc->editor->sci); len = strlen(environment); - + sci_start_undo_action(doc->editor->sci);
tmpstring = g_string_new("\begin{"); @@ -125,12 +126,16 @@ g_free(tmp);
indent = sci_get_line_indentation(doc->editor->sci, - sci_get_line_from_position(doc->editor->sci, pos)); + sci_get_line_from_position(doc->editor->sci, pos));
tmp = g_strdup_printf("\n\end{%s}\n", environment); glatex_insert_string(tmp, FALSE);
+ prefs = editor_get_indent_prefs(doc->editor); sci_set_line_indentation(doc->editor->sci, + sci_get_current_line(doc->editor->sci), + indent + prefs->width); + sci_set_line_indentation(doc->editor->sci, sci_get_current_line(doc->editor->sci) + 1, indent);
g_free(tmp);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.