Revision: 971 http://svn.sourceforge.net/geany/?rev=971&view=rev Author: eht16 Date: 2006-11-06 13:02:03 -0800 (Mon, 06 Nov 2006)
Log Message: ----------- Little code cleanup in brace_match().
Modified Paths: -------------- trunk/ChangeLog trunk/src/sci_cb.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-11-06 20:56:18 UTC (rev 970) +++ trunk/ChangeLog 2006-11-06 21:02:03 UTC (rev 971) @@ -3,6 +3,7 @@ * data/filetypes.java, src/highlighting.c: Added Java keywords true and false. Converted "NULL" to lower case. + * src/sci_cb.c: Little code cleanup in brace_match().
2006-11-05 Enrico Tröger enrico.troeger@uvena.de
Modified: trunk/src/sci_cb.c =================================================================== --- trunk/src/sci_cb.c 2006-11-06 20:56:18 UTC (rev 970) +++ trunk/src/sci_cb.c 2006-11-06 21:02:03 UTC (rev 971) @@ -259,12 +259,14 @@ } break; } -/* case SCN_STYLENEEDED: +#ifdef GEANY_DEBUG + case SCN_STYLENEEDED: { geany_debug("style"); break; } -*/ case SCN_URIDROPPED: +#endif + case SCN_URIDROPPED: { if (nt->text != NULL && strlen(nt->text) > 0) { @@ -386,20 +388,22 @@ { gchar chBrace = sci_get_char_at(sci, pos); gchar chSeek = utils_brace_opposite(chBrace); - gint direction, styBrace, depth = 1; + gchar chAtPos; + gint direction = -1; + gint styBrace; + gint depth = 1; + gint styAtPos;
- if (chSeek == '\0') return -1; styBrace = sci_get_style_at(sci, pos); - direction = -1;
- if (chBrace == '(' || chBrace == '[' || chBrace == '{' || chBrace == '<') + if (utils_is_opening_brace(chBrace)) direction = 1;
pos = pos + direction; while ((pos >= 0) && (pos < sci_get_length(sci))) { - gchar chAtPos = sci_get_char_at(sci, pos - 1); - gint styAtPos = sci_get_style_at(sci, pos); + chAtPos = sci_get_char_at(sci, pos - 1); + styAtPos = sci_get_style_at(sci, pos);
if ((pos > sci_get_end_styled(sci)) || (styAtPos == styBrace)) { @@ -412,7 +416,7 @@ } pos = pos + direction; } - return - 1; + return -1; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.