Revision: 2981 http://geany.svn.sourceforge.net/geany/?rev=2981&view=rev Author: ntrel Date: 2008-09-22 11:12:54 +0000 (Mon, 22 Sep 2008)
Log Message: ----------- Don't disable the auto-indent document pref when switching back to a document with auto-indent turned off.
Modified Paths: -------------- trunk/ChangeLog trunk/src/editor.c trunk/src/ui_utils.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-21 16:44:30 UTC (rev 2980) +++ trunk/ChangeLog 2008-09-22 11:12:54 UTC (rev 2981) @@ -1,3 +1,12 @@ +2008-09-22 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> + + * src/editor.c, src/ui_utils.c: + When the global auto-indent style pref is disabled, disable + auto-indentation for all editors. + Don't disable the auto-indent document pref when switching back to a + document with auto-indent turned off. + + 2008-09-21 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* document.c, document.h, editor.c, editor.h, prefs.c, sciwrappers.c,
Modified: trunk/src/editor.c =================================================================== --- trunk/src/editor.c 2008-09-21 16:44:30 UTC (rev 2980) +++ trunk/src/editor.c 2008-09-22 11:12:54 UTC (rev 2981) @@ -789,8 +789,13 @@ return &iprefs;
iprefs.type = editor->indent_type; + if (!editor->auto_indent) iprefs.auto_indent_mode = GEANY_AUTOINDENT_NONE; + else + if (iprefs.auto_indent_mode == GEANY_AUTOINDENT_NONE) + editor->auto_indent = FALSE; /* no global autoindent style to use */ + return &iprefs; }
@@ -3912,6 +3917,7 @@ void editor_apply_update_prefs(GeanyEditor *editor) { ScintillaObject *sci; + GtkWidget *item;
g_return_if_fail(editor != NULL);
@@ -3939,5 +3945,10 @@ sci_assign_cmdkey(sci, SCK_HOME, editor_prefs.smart_home_key ? SCI_VCHOMEWRAP : SCI_HOMEWRAP); sci_assign_cmdkey(sci, SCK_END, SCI_LINEENDWRAP); + + /* update some editor-related UI elements */ + item = lookup_widget(main_widgets.window, "menu_use_auto_indentation1"); + gtk_widget_set_sensitive(item, + editor_prefs.indentation->auto_indent_mode != GEANY_AUTOINDENT_NONE); }
Modified: trunk/src/ui_utils.c =================================================================== --- trunk/src/ui_utils.c 2008-09-21 16:44:30 UTC (rev 2980) +++ trunk/src/ui_utils.c 2008-09-22 11:12:54 UTC (rev 2981) @@ -722,8 +722,6 @@
item = lookup_widget(main_widgets.window, "menu_use_auto_indentation1"); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), doc->editor->auto_indent); - gtk_widget_set_sensitive(item, - iprefs->auto_indent_mode != GEANY_AUTOINDENT_NONE);
switch (iprefs->type) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.