Index: src/interface.c
===================================================================
--- src/interface.c	(revision 964)
+++ src/interface.c	(working copy)
@@ -2262,6 +2262,7 @@
   GtkWidget *alignment17;
   GtkWidget *vbox17;
   GtkWidget *check_auto_indent;
+  GtkWidget *check_matching_braces_different_indentation;
   GtkWidget *check_line_wrapping;
   GtkWidget *check_auto_complete;
   GtkWidget *check_xmltag;
@@ -3068,6 +3069,11 @@
   gtk_box_pack_start (GTK_BOX (vbox17), check_auto_indent, FALSE, FALSE, 0);
   gtk_tooltips_set_tip (tooltips, check_auto_indent, _("Add the same indentation as the previous line after pressing enter"), NULL);
 
+  check_matching_braces_different_indentation = gtk_check_button_new_with_mnemonic (_("Matching braces have different indentation"));
+  gtk_widget_show (check_matching_braces_different_indentation);
+  gtk_box_pack_start (GTK_BOX (vbox17), check_matching_braces_different_indentation, FALSE, FALSE, 0);
+  gtk_tooltips_set_tip (tooltips, check_matching_braces_different_indentation, _("Matching braces have different indentation (Coding Style)"), NULL);
+
   check_line_wrapping = gtk_check_button_new_with_mnemonic (_("Line wrapping"));
   gtk_widget_show (check_line_wrapping);
   gtk_box_pack_start (GTK_BOX (vbox17), check_line_wrapping, FALSE, FALSE, 0);
@@ -3534,6 +3540,7 @@
   GLADE_HOOKUP_OBJECT (prefs_dialog, check_auto_indent, "check_auto_indent");
   GLADE_HOOKUP_OBJECT (prefs_dialog, check_line_wrapping, "check_line_wrapping");
   GLADE_HOOKUP_OBJECT (prefs_dialog, check_auto_complete, "check_auto_complete");
+  GLADE_HOOKUP_OBJECT (prefs_dialog, check_matching_braces_different_indentation, "check_matching_braces_different_indentation");
   GLADE_HOOKUP_OBJECT (prefs_dialog, check_xmltag, "check_xmltag");
   GLADE_HOOKUP_OBJECT (prefs_dialog, check_folding, "check_folding");
   GLADE_HOOKUP_OBJECT (prefs_dialog, check_indicators, "check_indicators");
Index: src/geany.h
===================================================================
--- src/geany.h	(revision 964)
+++ src/geany.h	(working copy)
@@ -98,6 +98,7 @@
 	// to change the default value at startup, I think
 	gboolean			 pref_editor_line_breaking;
 	gboolean			 pref_editor_use_auto_indention;
+	gboolean			 pref_editor_check_matching_braces_different_indentation;
 	gboolean			 pref_editor_use_indicators;
 	gboolean			 pref_editor_show_white_space;
 	gboolean			 pref_editor_show_indent_guide;
Index: src/sci_cb.c
===================================================================
--- src/sci_cb.c	(revision 964)
+++ src/sci_cb.c	(working copy)
@@ -218,8 +218,11 @@
 				}
 				case '}':
 				{	// closing bracket handling
-					if (doc_list[idx].use_auto_indention) sci_cb_close_block(idx, pos - 1);
-					break;
+					if(!app->pref_editor_check_matching_braces_different_indentation)
+					{
+						if (doc_list[idx].use_auto_indention) sci_cb_close_block(idx, pos - 1);
+							break;
+					}
 				}
 				default: sci_cb_start_auto_complete(idx, pos, FALSE);
 			}
Index: src/keyfile.c
===================================================================
--- src/keyfile.c	(revision 964)
+++ src/keyfile.c	(working copy)
@@ -104,6 +104,7 @@
 	g_key_file_set_boolean(config, PACKAGE, "msgwindow_visible", app->msgwindow_visible);
 	g_key_file_set_boolean(config, PACKAGE, "use_folding", app->pref_editor_folding);
 	g_key_file_set_boolean(config, PACKAGE, "use_auto_indention", app->pref_editor_use_auto_indention);
+	g_key_file_set_boolean(config, PACKAGE, "pref_editor_check_matching_braces_different_indentation", app->pref_editor_check_matching_braces_different_indentation);
 	g_key_file_set_boolean(config, PACKAGE, "use_indicators", app->pref_editor_use_indicators);
 	g_key_file_set_boolean(config, PACKAGE, "show_indent_guide", app->pref_editor_show_indent_guide);
 	g_key_file_set_boolean(config, PACKAGE, "show_white_space", app->pref_editor_show_white_space);
@@ -304,6 +305,7 @@
 	app->msgwindow_visible = utils_get_setting_boolean(config, PACKAGE, "msgwindow_visible", TRUE);
 	app->pref_editor_line_breaking = utils_get_setting_boolean(config, PACKAGE, "line_breaking", FALSE); //default is off for better performance
 	app->pref_editor_use_auto_indention = utils_get_setting_boolean(config, PACKAGE, "use_auto_indention", TRUE);
+	app->pref_editor_check_matching_braces_different_indentation = utils_get_setting_boolean(config, PACKAGE, "pref_editor_check_matching_braces_different_indentation", TRUE);
 	app->pref_editor_use_indicators = utils_get_setting_boolean(config, PACKAGE, "use_indicators", TRUE);
 	app->pref_editor_show_indent_guide = utils_get_setting_boolean(config, PACKAGE, "show_indent_guide", FALSE);
 	app->pref_editor_show_white_space = utils_get_setting_boolean(config, PACKAGE, "show_white_space", FALSE);
Index: src/prefs.c
===================================================================
--- src/prefs.c	(revision 964)
+++ src/prefs.c	(working copy)
@@ -223,6 +223,9 @@
 	widget = lookup_widget(app->prefs_dialog, "check_auto_indent");
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_editor_use_auto_indention);
 
+	widget = lookup_widget(app->prefs_dialog, "check_matching_braces_different_indentation");
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_editor_check_matching_braces_different_indentation);
+
 	widget = lookup_widget(app->prefs_dialog, "check_line_wrapping");
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_editor_line_breaking);
 
@@ -523,6 +526,9 @@
 		widget = lookup_widget(app->prefs_dialog, "check_auto_complete");
 		app->pref_editor_auto_complete_constructs = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
 
+		widget = lookup_widget(app->prefs_dialog, "check_matching_braces_different_indentation");
+		app->pref_editor_check_matching_braces_different_indentation = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+
 		widget = lookup_widget(app->prefs_dialog, "check_xmltag");
 		app->pref_editor_auto_close_xml_tags = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 964)
+++ ChangeLog	(working copy)
@@ -1,3 +1,11 @@
+2006-11-03  Bob Doan  <bdoan@sicompos.com>
+	* geany.glade: Add preference for matching braces have different indentation
+	* src/geany.h: likewise
+	* src/interface.c: likewise
+	* src/keyfile.c: likewise
+	* src/prefs.c: likewise
+	* src/sci_cb.c: Wire up preference
+
 2006-11-03  Nick Treleaven  <nick.treleaven@btinternet.com>
 
  * src/msgwindow.c:
Index: geany.glade
===================================================================
--- geany.glade	(revision 964)
+++ geany.glade	(working copy)
@@ -4978,6 +4978,26 @@
 			  </child>
 
 			  <child>
+			    <widget class="GtkCheckButton" id="check_matching_braces_different_indentation">
+			      <property name="visible">True</property>
+			      <property name="tooltip" translatable="yes">Matching braces have different indentation (Coding Style)</property>
+			      <property name="can_focus">True</property>
+			      <property name="label" translatable="yes">Matching braces have different indentation</property>
+			      <property name="use_underline">True</property>
+			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
+			      <property name="active">False</property>
+			      <property name="inconsistent">False</property>
+			      <property name="draw_indicator">True</property>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
+			    </packing>
+			  </child>
+
+			  <child>
 			    <widget class="GtkCheckButton" id="check_line_wrapping">
 			      <property name="visible">True</property>
 			      <property name="tooltip" translatable="yes">Wrap the line at the window border and continue it on the next line. Note: line wrapping has a high performance cost for large documents so should be disabled on slow machines.</property>
