From 7a4ca2b10e3698d7f61f6380777d69543f91d049 Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Thu, 22 Nov 2007 16:10:50 -0600 Subject: [PATCH] Check extensions before mime types when looking up language --- moo/mooedit/moolangmgr.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/moo/mooedit/moolangmgr.c b/moo/mooedit/moolangmgr.c index cbd5d240..c6590f7d 100644 --- a/moo/mooedit/moolangmgr.c +++ b/moo/mooedit/moolangmgr.c @@ -387,6 +387,16 @@ moo_lang_mgr_get_lang_for_file (MooLangMgr *mgr, if (file_blacklisted (mgr, filename)) return NULL; + lang = get_lang_by_extension (mgr, filename); + + if (lang) + return lang; + + lang = lang_mgr_get_lang_for_bak_filename (mgr, filename); + + if (lang) + return lang; + #ifdef MOO_USE_XDGMIME /* XXX: xdgmime wants utf8-encoded filename here. is it a problem? */ /* It's a big problem! */ @@ -403,16 +413,6 @@ moo_lang_mgr_get_lang_for_file (MooLangMgr *mgr, #endif #endif /* MOO_USE_XDGMIME */ - lang = get_lang_by_extension (mgr, filename); - - if (lang) - return lang; - - lang = lang_mgr_get_lang_for_bak_filename (mgr, filename); - - if (lang) - return lang; - return NULL; }