Revision: 3379 http://geany.svn.sourceforge.net/geany/?rev=3379&view=rev Author: eht16 Date: 2008-12-15 21:20:04 +0000 (Mon, 15 Dec 2008)
Log Message: ----------- Replace the 'else if's by a switch contruct.
Modified Paths: -------------- trunk/src/editor.c
Modified: trunk/src/editor.c =================================================================== --- trunk/src/editor.c 2008-12-15 21:19:44 UTC (rev 3378) +++ trunk/src/editor.c 2008-12-15 21:20:04 UTC (rev 3379) @@ -1015,26 +1015,29 @@ if (utils_isbrace(c, 0)) end_pos = SSM(sci, SCI_BRACEMATCH, pos - 1, 0);
- if ((editor_prefs.autoclose_chars & GEANY_AC_PARENTHESIS) && end_pos == -1 && c == '(') + switch (c) { - closing_char = ")"; + case '(': + if ((editor_prefs.autoclose_chars & GEANY_AC_PARENTHESIS) && end_pos == -1) + closing_char = ")"; + break; + case '{': + if ((editor_prefs.autoclose_chars & GEANY_AC_CBRACKET) && end_pos == -1) + closing_char = "}"; + break; + case '[': + if ((editor_prefs.autoclose_chars & GEANY_AC_SBRACKET) && end_pos == -1) + closing_char = "]"; + break; + case ''': + if (editor_prefs.autoclose_chars & GEANY_AC_SQUOTE) + closing_char = "'"; + break; + case '"': + if (editor_prefs.autoclose_chars & GEANY_AC_DQUOTE) + closing_char = """; + break; } - else if ((editor_prefs.autoclose_chars & GEANY_AC_CBRACKET) && end_pos == -1 && c == '{') - { - closing_char = "}"; - } - else if ((editor_prefs.autoclose_chars & GEANY_AC_SBRACKET) && end_pos == -1 && c == '[') - { - closing_char = "]"; - } - else if ((editor_prefs.autoclose_chars & GEANY_AC_SQUOTE) && c == ''') - { - closing_char = "'"; - } - else if ((editor_prefs.autoclose_chars & GEANY_AC_DQUOTE) && c == '"') - { - closing_char = """; - }
if (closing_char != NULL) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.