diff --git a/moo/mooedit/mooeditor.c b/moo/mooedit/mooeditor.c index bd8a1b4e..f1b64f90 100644 --- a/moo/mooedit/mooeditor.c +++ b/moo/mooedit/mooeditor.c @@ -862,7 +862,7 @@ moo_editor_add_doc (MooEditor *editor, editor->priv->default_lang) { moo_edit_config_set (doc->config, - "lang", MOO_EDIT_CONFIG_SOURCE_AUTO, + "lang", MOO_EDIT_CONFIG_SOURCE_FILENAME, editor->priv->default_lang, NULL); } } @@ -1864,10 +1864,16 @@ apply_prefs (MooEditor *editor) GSList *docs; gboolean use_tabs, autosave, backups, strip; int indent_width, autosave_interval; - const char *color_scheme; + const char *color_scheme, *default_lang; editor->priv->prefs_idle = 0; + moo_prefs_new_key_string (moo_edit_setting (MOO_EDIT_PREFS_DEFAULT_LANG), NULL); + default_lang = moo_prefs_get_string (moo_edit_setting (MOO_EDIT_PREFS_DEFAULT_LANG)); + + if (default_lang) + moo_editor_set_default_lang (editor, default_lang); + use_tabs = !moo_prefs_get_bool (moo_edit_setting (MOO_EDIT_PREFS_SPACES_NO_TABS)); indent_width = moo_prefs_get_int (moo_edit_setting (MOO_EDIT_PREFS_INDENT_WIDTH)); strip = moo_prefs_get_bool (moo_edit_setting (MOO_EDIT_PREFS_STRIP)); diff --git a/moo/mooedit/mooeditprefs.h b/moo/mooedit/mooeditprefs.h index 619579a8..fb19113b 100644 --- a/moo/mooedit/mooeditprefs.h +++ b/moo/mooedit/mooeditprefs.h @@ -28,6 +28,7 @@ GtkWidget *moo_edit_colors_prefs_page_new (MooEditor *editor); /* defined in mooeditprefs.c */ const char *moo_edit_setting (const char *setting_name); +#define MOO_EDIT_PREFS_DEFAULT_LANG "default_lang" #define MOO_EDIT_PREFS_SPACES_NO_TABS "spaces_instead_of_tabs" #define MOO_EDIT_PREFS_INDENT_WIDTH "indent_width"