SF.net SVN: geany: [399] trunk
eht16 at users.sourceforge.net
eht16 at xxxxx
Sat Jun 3 15:05:46 UTC 2006
Revision: 399
Author: eht16
Date: 2006-06-03 08:05:41 -0700 (Sat, 03 Jun 2006)
ViewCVS: http://svn.sourceforge.net/geany/?rev=399&view=rev
Log Message:
-----------
Fixed bug in auto completion of constructs.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/sci_cb.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-06-03 14:20:59 UTC (rev 398)
+++ trunk/ChangeLog 2006-06-03 15:05:41 UTC (rev 399)
@@ -1,3 +1,8 @@
+2006-06-03 Enrico Troeger <enrico.troeger at uvena.de>
+
+ * src/sci_cb.c: Fixed bug in auto completion of constructs.
+
+
2006-06-03 Nick Treleaven <nick.treleaven at btinternet.com>
* doc/geany.docbook: More minor corrections/rewording.
@@ -6,8 +11,8 @@
2006-06-02 Enrico Troeger <enrico.troeger at uvena.de>
* src/highlighting.c, data/filetypes.css: improved colouring
- * src/utils.c: added some sanity checks if filetype is NULL
- * src/utils.c: corrected readme text for filedefs/filetypes.README
+ * src/utils.c: Added some sanity checks if filetype is NULL.
+ * src/utils.c: Corrected readme text for filedefs/filetypes.README.
2006-06-02 Nick Treleaven <nick.treleaven at btinternet.com>
Modified: trunk/src/sci_cb.c
===================================================================
--- trunk/src/sci_cb.c 2006-06-03 14:20:59 UTC (rev 398)
+++ trunk/src/sci_cb.c 2006-06-03 15:05:41 UTC (rev 399)
@@ -564,6 +564,8 @@
// "pattern", buf + x, y -> x + y = 6, because buf is (pos - 7)...(pos - 1) = 6
if (! strncmp("if", buf + 4, 2))
{
+ if (! isspace(*(buf + 3))) goto free_and_return;
+
construct = g_strdup_printf("()%s{%s\t%s}%s", eol, eol, eol, eol);
SSM(sci, SCI_INSERTTEXT, pos, (sptr_t) construct);
@@ -572,6 +574,8 @@
}
else if (! strncmp("else", buf + 2, 4))
{
+ if (! isspace(*(buf + 1))) goto free_and_return;
+
construct = g_strdup_printf("%s{%s\t%s}%s", eol, eol, eol, eol);
SSM(sci, SCI_INSERTTEXT, pos, (sptr_t) construct);
@@ -582,6 +586,9 @@
{
gchar *var;
gint contruct_len;
+
+ if (! isspace(*(buf + 2))) goto free_and_return;
+
if (doc_list[idx].file_type->id == GEANY_FILETYPES_PHP)
{
var = g_strdup("$i");
@@ -606,6 +613,8 @@
}
else if (! strncmp("while", buf + 1, 5))
{
+ if (! isspace(*buf)) goto free_and_return;
+
construct = g_strdup_printf("()%s{%s\t%s}%s", eol, eol, eol, eol);
SSM(sci, SCI_INSERTTEXT, pos, (sptr_t) construct);
@@ -614,6 +623,8 @@
}
else if (! strncmp("do", buf + 4, 2))
{
+ if (! isspace(*(buf + 3))) goto free_and_return;
+
construct = g_strdup_printf("%s{%s\t%s}%swhile ();%s", eol, eol, eol, eol, eol);
SSM(sci, SCI_INSERTTEXT, pos, (sptr_t) construct);
@@ -622,6 +633,8 @@
}
else if (! strncmp("try", buf + 3, 3))
{
+ if (! isspace(*(buf + 2))) goto free_and_return;
+
construct = g_strdup_printf("%s{%s\t%s}%scatch ()%s{%s\t%s}%s",
eol, eol, eol, eol, eol, eol, eol, eol);
@@ -631,12 +644,16 @@
}
else if (! strncmp("switch", buf, 5))
{
+ if (! isspace(*(buf + 4))) goto free_and_return;
+
construct = g_strdup_printf("()%s{%s\tcase : break;%s\tdefault: %s}%s", eol, eol, eol, eol, eol);
SSM(sci, SCI_INSERTTEXT, pos, (sptr_t) construct);
sci_goto_pos(sci, pos + 1, TRUE);
g_free(construct);
}
+
+ free_and_return:
g_free(eol);
}
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