From 3a44db510b1661eb92689e328d5191acfcb95433 Mon Sep 17 00:00:00 2001 From: bfredl Date: Wed, 11 Oct 2023 22:16:25 +0200 Subject: refactor(lang): reduce scope of HAVE_WORKING_LIBINTL #ifdefs A lot of code inside HAVE_WORKING_LIBINTL doesn't really depend on a "working libintl". For instance ex_language is also used for ":lang collate" and ":lang time". Also ":lang C" should not fail just because translations aren't available (it just means use the default text). References: https://github.com/neovim/neovim/pull/1 2d00ead2e57653b771354a564f9a760c2ce0d18e separate ifdefs for locale and gettext got merged together. https://github.com/neovim/neovim/commit/8253e29971c54310434ee93d987a99994769d717 Unmotivated switcharoo of get_mess_env() logic. If available, get_locale_val(LC_MESSAGES) is the correct implementation. --- src/nvim/cmdexpand.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/nvim/cmdexpand.c') diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c index bf0aa54bdd..3cc9515fef 100644 --- a/src/nvim/cmdexpand.c +++ b/src/nvim/cmdexpand.c @@ -2130,10 +2130,9 @@ static const char *set_context_by_cmdname(const char *cmd, cmdidx_T cmdidx, expa set_context_in_runtime_cmd(xp, arg); break; -#ifdef HAVE_WORKING_LIBINTL case CMD_language: return set_context_in_lang_cmd(xp, arg); -#endif + case CMD_profile: set_context_in_profile_cmd(xp, arg); break; @@ -2644,10 +2643,8 @@ static int ExpandOther(char *pat, expand_T *xp, regmatch_T *rmp, char ***matches { EXPAND_AUGROUP, expand_get_augroup_name, true, false }, { EXPAND_SIGN, get_sign_name, true, true }, { EXPAND_PROFILE, get_profile_name, true, true }, -#ifdef HAVE_WORKING_LIBINTL { EXPAND_LANGUAGE, get_lang_arg, true, false }, { EXPAND_LOCALES, get_locales, true, false }, -#endif { EXPAND_ENV_VARS, get_env_name, true, true }, { EXPAND_USER, get_users, true, false }, { EXPAND_ARGLIST, get_arglist_name, true, false }, -- cgit