Don't present users with the hidden highlight languages (#167)
Fixes a crash when choosing 'Defaults' as the the highlight language.
Adapted from 0434e2f918
Closes https://github.com/linuxmint/xed/issues/160
This commit is contained in:
parent
1f85332906
commit
54a8c6c616
|
@ -837,8 +837,12 @@ get_languages_sorted_by_section (XedWindow *window)
|
|||
GtkSourceLanguage *lang;
|
||||
|
||||
lang = gtk_source_language_manager_get_language (lm, ids[i]);
|
||||
|
||||
if (!gtk_source_language_get_hidden (lang))
|
||||
{
|
||||
languages = g_slist_prepend (languages, lang);
|
||||
}
|
||||
}
|
||||
|
||||
return g_slist_sort (languages, (GCompareFunc)language_compare);
|
||||
}
|
||||
|
@ -1691,6 +1695,9 @@ fill_language_combo (XedWindow *window)
|
|||
GtkSourceLanguage *lang;
|
||||
|
||||
lang = gtk_source_language_manager_get_language (lm, ids[i]);
|
||||
|
||||
if (!gtk_source_language_get_hidden (lang))
|
||||
{
|
||||
name = gtk_source_language_get_name (lang);
|
||||
menu_item = gtk_menu_item_new_with_label (name);
|
||||
gtk_widget_show (menu_item);
|
||||
|
@ -1701,6 +1708,7 @@ fill_language_combo (XedWindow *window)
|
|||
GTK_MENU_ITEM (menu_item), name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
create_statusbar (XedWindow *window,
|
||||
|
|
Loading…
Reference in New Issue