diff options
author | Lewis Russell <lewis6991@gmail.com> | 2023-04-17 17:23:47 +0100 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-04-28 23:04:09 +0800 |
commit | ff34c91194f9ab9d02808f2880029c38a4655eb5 (patch) | |
tree | fc0eb2a8e58b92e6af59411165a0127af63dd552 /src/nvim/mapping.c | |
parent | 715587f8e44e941ece6f17eb77620fd1b4719496 (diff) | |
download | rneovim-ff34c91194f9ab9d02808f2880029c38a4655eb5.tar.gz rneovim-ff34c91194f9ab9d02808f2880029c38a4655eb5.tar.bz2 rneovim-ff34c91194f9ab9d02808f2880029c38a4655eb5.zip |
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 vim/vim#12015)
https://github.com/vim/vim/commit/af93691b53f38784efce0b93fe7644c44a7e382e
Diffstat (limited to 'src/nvim/mapping.c')
-rw-r--r-- | src/nvim/mapping.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c index 9a835e0eb8..a2f2ed4d86 100644 --- a/src/nvim/mapping.c +++ b/src/nvim/mapping.c @@ -2386,7 +2386,7 @@ void langmap_init(void) /// Called when langmap option is set; the language map can be /// changed at any time! -void langmap_set(void) +const char *did_set_langmap(optset_T *args FUNC_ATTR_UNUSED) { char *p; char *p2; @@ -2434,9 +2434,11 @@ void langmap_set(void) } } if (to == NUL) { + // TODO(vim): Need to use errbuf argument for this error message + // and return it. semsg(_("E357: 'langmap': Matching character missing for %s"), transchar(from)); - return; + return NULL; } if (from >= 256) { @@ -2454,8 +2456,10 @@ void langmap_set(void) p = p2; if (p[0] != NUL) { if (p[0] != ',') { + // TODO(vim): Need to use errbuf argument for this error + // message and return it. semsg(_("E358: 'langmap': Extra characters after semicolon: %s"), p); - return; + return NULL; } p++; } @@ -2464,6 +2468,8 @@ void langmap_set(void) } } } + + return NULL; } static void do_exmap(exarg_T *eap, int isabbrev) |