SF.net SVN: geany: [1050] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Mon Dec 4 16:09:58 UTC 2006


Revision: 1050
          http://svn.sourceforge.net/geany/?rev=1050&view=rev
Author:   eht16
Date:     2006-12-04 08:09:57 -0800 (Mon, 04 Dec 2006)

Log Message:
-----------
Fixed broken auto completion for LaTeX files.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/sci_cb.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-12-04 15:32:40 UTC (rev 1049)
+++ trunk/ChangeLog	2006-12-04 16:09:57 UTC (rev 1050)
@@ -11,6 +11,7 @@
 
  * src/document.c: Use default GTK foreground colour for filenames on
                    notebook tabs instead of hardcoded colour black.
+ * src/sci_cb.c: Fixed broken auto completion for LaTeX files.
 
 
 2006-12-03  Enrico Tröger  <enrico.troeger at uvena.de>

Modified: trunk/src/sci_cb.c
===================================================================
--- trunk/src/sci_cb.c	2006-12-04 15:32:40 UTC (rev 1049)
+++ trunk/src/sci_cb.c	2006-12-04 16:09:57 UTC (rev 1050)
@@ -634,7 +634,7 @@
 	const GPtrArray *tags;
 	ScintillaObject *sci;
 
-	if (idx == -1 || ! doc_list[idx].is_valid || doc_list[idx].file_type == NULL)
+	if (! DOC_IDX_VALID(idx) || doc_list[idx].file_type == NULL)
 		return FALSE;
 	sci = doc_list[idx].sci;
 
@@ -663,8 +663,9 @@
 	gchar *linebuf, *root;
 	ScintillaObject *sci;
 	gboolean ret = FALSE;
+	gchar *wordchars;
 
-	if (idx < 0 || ! doc_list[idx].is_valid || doc_list[idx].file_type == NULL) return FALSE;
+	if (! DOC_IDX_VALID(idx) || doc_list[idx].file_type == NULL) return FALSE;
 	sci = doc_list[idx].sci;
 
 	line = sci_get_line_from_position(sci, pos);
@@ -709,8 +710,13 @@
 
 	linebuf = sci_get_line(sci, line);
 
+	if (doc_list[idx].file_type->id == GEANY_FILETYPES_LATEX)
+		wordchars = GEANY_WORDCHARS"\\"; // add \ to word chars if we are in a LaTeX file
+	else
+		wordchars = GEANY_WORDCHARS;
+
 	// find the start of the current word
-	while ((startword > 0) && (strchr(GEANY_WORDCHARS, linebuf[startword - 1])))
+	while ((startword > 0) && (strchr(wordchars, linebuf[startword - 1])))
 		startword--;
 	linebuf[current] = '\0';
 	root = linebuf + startword;


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