SF.net SVN: geany-plugins:[1211] trunk/geanylatex/src/latexenvironments.c

frlan at users.sourceforge.net frlan at xxxxx
Sat Mar 27 10:00:23 UTC 2010


Revision: 1211
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1211&view=rev
Author:   frlan
Date:     2010-03-27 10:00:23 +0000 (Sat, 27 Mar 2010)

Log Message:
-----------
GeanyLaTeX: Set markers for single undo on inserting environment

Modified Paths:
--------------
    trunk/geanylatex/src/latexenvironments.c

Modified: trunk/geanylatex/src/latexenvironments.c
===================================================================
--- trunk/geanylatex/src/latexenvironments.c	2010-03-27 09:41:47 UTC (rev 1210)
+++ trunk/geanylatex/src/latexenvironments.c	2010-03-27 10:00:23 UTC (rev 1211)
@@ -73,6 +73,7 @@
 			gchar *replacement = NULL;
 			selection = sci_get_selection_contents(doc->editor->sci);
 
+			sci_start_undo_action(doc->editor->sci);
 			if (utils_str_equal(environment, "block") == TRUE)
 			{
 				replacement = g_strconcat("\\begin{", environment, "}{}\n",
@@ -84,6 +85,7 @@
 							  selection, "\n\\end{", environment, "}\n", NULL);
 			}
 			sci_replace_sel(doc->editor->sci, replacement);
+			sci_end_undo_action(doc->editor->sci);
 			g_free(selection);
 			g_free(replacement);
 
@@ -95,6 +97,7 @@
 			GString *tmpstring = NULL;
 			gchar *tmp = NULL;
 
+			sci_start_undo_action(doc->editor->sci);
 			tmpstring = g_string_new("\\begin{");
 			g_string_append(tmpstring, environment);
 
@@ -120,6 +123,7 @@
 			tmp = g_string_free(tmpstring, FALSE);
 			glatex_insert_string(tmp, FALSE);
 			sci_set_current_position(doc->editor->sci, pos + len + 9, TRUE);
+			sci_end_undo_action(doc->editor->sci);
 			g_free(tmp);
 		}
 	}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Plugins-Commits mailing list