mirror of
https://github.com/neovim/neovim.git
synced 2025-10-11 20:36:35 +00:00
refactor: follow style guide
This commit is contained in:
@@ -100,9 +100,7 @@ static char *get_mess_env(void)
|
||||
/// Also do "v:lc_time"and "v:ctype".
|
||||
void set_lang_var(void)
|
||||
{
|
||||
const char *loc;
|
||||
|
||||
loc = get_locale_val(LC_CTYPE);
|
||||
const char *loc = get_locale_val(LC_CTYPE);
|
||||
set_vim_var_string(VV_CTYPE, loc, -1);
|
||||
|
||||
loc = get_mess_env();
|
||||
@@ -143,8 +141,6 @@ void init_locale(void)
|
||||
void ex_language(exarg_T *eap)
|
||||
{
|
||||
char *loc;
|
||||
char *p;
|
||||
char *name;
|
||||
int what = LC_ALL;
|
||||
char *whatstr = "";
|
||||
#ifdef LC_MESSAGES
|
||||
@@ -153,12 +149,12 @@ void ex_language(exarg_T *eap)
|
||||
# define VIM_LC_MESSAGES 6789
|
||||
#endif
|
||||
|
||||
name = eap->arg;
|
||||
char *name = eap->arg;
|
||||
|
||||
// Check for "messages {name}", "ctype {name}" or "time {name}" argument.
|
||||
// Allow abbreviation, but require at least 3 characters to avoid
|
||||
// confusion with a two letter language name "me" or "ct".
|
||||
p = skiptowhite(eap->arg);
|
||||
char *p = skiptowhite(eap->arg);
|
||||
if ((*p == NUL || ascii_iswhite(*p)) && p - eap->arg >= 3) {
|
||||
if (STRNICMP(eap->arg, "messages", p - eap->arg) == 0) {
|
||||
what = VIM_LC_MESSAGES;
|
||||
@@ -249,7 +245,6 @@ static bool did_init_locales = false;
|
||||
static char **find_locales(void)
|
||||
{
|
||||
garray_T locales_ga;
|
||||
char *loc;
|
||||
char *saveptr = NULL;
|
||||
|
||||
// Find all available locales by running command "locale -a". If this
|
||||
@@ -262,7 +257,7 @@ static char **find_locales(void)
|
||||
|
||||
// Transform locale_a string where each locale is separated by "\n"
|
||||
// into an array of locale strings.
|
||||
loc = os_strtok(locale_a, "\n", &saveptr);
|
||||
char *loc = os_strtok(locale_a, "\n", &saveptr);
|
||||
|
||||
while (loc != NULL) {
|
||||
loc = xstrdup(loc);
|
||||
|
Reference in New Issue
Block a user