SF.net SVN: geany:[4621] branches/geany-0.18.1

eht16 at users.sourceforge.net eht16 at xxxxx
Sun Jan 31 21:51:34 UTC 2010


Revision: 4621
          http://geany.svn.sourceforge.net/geany/?rev=4621&view=rev
Author:   eht16
Date:     2010-01-31 21:51:34 +0000 (Sun, 31 Jan 2010)

Log Message:
-----------
Backport from trunk:
Fix LaTeX environment auto completion with CR/LF line endings.
Add some sanity checks.

Modified Paths:
--------------
    branches/geany-0.18.1/ChangeLog
    branches/geany-0.18.1/src/editor.c

Modified: branches/geany-0.18.1/ChangeLog
===================================================================
--- branches/geany-0.18.1/ChangeLog	2010-01-31 21:51:23 UTC (rev 4620)
+++ branches/geany-0.18.1/ChangeLog	2010-01-31 21:51:34 UTC (rev 4621)
@@ -10,6 +10,13 @@
    Add gcc commands to build a plugin to the HowTo.
 
 
+2009-12-20  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
+
+ * src/editor.c:
+   Fix LaTeX environment auto completion with CR/LF line endings.
+   Add some sanity checks.
+
+
 2009-12-20  Frank Lanitz  <frank(at)frank(dot)uvena(dot)de>
 
  * src/editor.c:

Modified: branches/geany-0.18.1/src/editor.c
===================================================================
--- branches/geany-0.18.1/src/editor.c	2010-01-31 21:51:23 UTC (rev 4620)
+++ branches/geany-0.18.1/src/editor.c	2010-01-31 21:51:34 UTC (rev 4621)
@@ -1944,7 +1944,7 @@
 
 	sci = editor->sci;
 
-	if (sci_get_char_at(sci, pos - 2) == '}')
+	if (sci_get_char_at(sci, pos - 1 - editor_get_eol_char_len(editor)) == '}')
 	{
 		gchar *eol, *buf, *construct;
 		gchar env[50];
@@ -1957,8 +1957,8 @@
 
 		/* get to the first non-blank char (some kind of ltrim()) */
 		start = 0;
-		/*while (isspace(buf[i++])) start++;*/
-		while (isspace(buf[start])) start++;
+		while (isspace(buf[start]) && buf[start] != '\0')
+			start++;
 
 		/* check for begin */
 		if (strncmp(buf + start, "\\begin", 6) == 0)
@@ -2006,7 +2006,7 @@
 				tmp = sci_get_line(sci, line + i);
 				/* Again get to the first non-blank char */
 				start = 0;
-				while (isspace(buf[start]))
+				while (isspace(buf[start]) && buf[start] != '\0')
 					start++;
 				end_construct = g_strdup_printf("\\end%s{%s}", full_cmd, env);
 				if (strstr(tmp, end_construct) != NULL)


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



More information about the Commits mailing list