summaryrefslogtreecommitdiffstats
path: root/src/map.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2023-02-20 12:16:39 +0000
committerBram Moolenaar <Bram@vim.org>2023-02-20 12:16:39 +0000
commitaf93691b53f38784efce0b93fe7644c44a7e382e (patch)
tree74e8f31e222aed907e80c4dc5b0bded5f7400537 /src/map.c
parent997b8a015cd39141866e953651d55c705275cbd6 (diff)
patch 9.0.1330: handling new value of an option has a long "else if" chainv9.0.1330
Problem: Handling new value of an option has a long "else if" chain. Solution: Use a function pointer. (Yegappan Lakshmanan, closes #12015)
Diffstat (limited to 'src/map.c')
-rw-r--r--src/map.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/map.c b/src/map.c
index 9a6cdb143c..92f76512ab 100644
--- a/src/map.c
+++ b/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