forked from aniani/vim
patch 9.0.1330: handling new value of an option has a long "else if" chain
Problem: Handling new value of an option has a long "else if" chain. Solution: Use a function pointer. (Yegappan Lakshmanan, closes #12015)
This commit is contained in:
committed by
Bram Moolenaar
parent
997b8a015c
commit
af93691b53
14
src/map.c
14
src/map.c
@@ -3034,8 +3034,8 @@ langmap_init(void)
|
||||
* Called when langmap option is set; the language map can be
|
||||
* changed at any time!
|
||||
*/
|
||||
void
|
||||
langmap_set(void)
|
||||
char *
|
||||
did_set_langmap(optset_T *args UNUSED)
|
||||
{
|
||||
char_u *p;
|
||||
char_u *p2;
|
||||
@@ -3088,9 +3088,11 @@ langmap_set(void)
|
||||
}
|
||||
if (to == NUL)
|
||||
{
|
||||
// TODO: Need to use errbuf argument for this error message
|
||||
// and return it.
|
||||
semsg(_(e_langmap_matching_character_missing_for_str),
|
||||
transchar(from));
|
||||
return;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (from >= 256)
|
||||
@@ -3110,8 +3112,10 @@ langmap_set(void)
|
||||
{
|
||||
if (p[0] != ',')
|
||||
{
|
||||
// TODO: Need to use errbuf argument for this error
|
||||
// message and return it.
|
||||
semsg(_(e_langmap_extra_characters_after_semicolon_str), p);
|
||||
return;
|
||||
return NULL;
|
||||
}
|
||||
++p;
|
||||
}
|
||||
@@ -3120,6 +3124,8 @@ langmap_set(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user