diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-25 19:01:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-25 19:01:48 +0800 |
commit | 6e9a7e7db81b899553548b82b42bf5c162109e19 (patch) | |
tree | a313a1b2f01708f784d3af2a98c3444592c3ac3d /src/nvim/api/options.c | |
parent | 6c26d0b068a3aee4155f38bbf52e3568073ede8a (diff) | |
parent | aba3147cb62339714633b53f9ba114b08c5d6761 (diff) | |
download | rneovim-6e9a7e7db81b899553548b82b42bf5c162109e19.tar.gz rneovim-6e9a7e7db81b899553548b82b42bf5c162109e19.tar.bz2 rneovim-6e9a7e7db81b899553548b82b42bf5c162109e19.zip |
Merge pull request #19493 from zeertzjq/vim-8.2.1469
vim-patch:8.2.{1469,2254,2284,2285,2969,4228}: option fixes and refactorings
Diffstat (limited to 'src/nvim/api/options.c')
-rw-r--r-- | src/nvim/api/options.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/nvim/api/options.c b/src/nvim/api/options.c index 4ed676e613..5c9eba163b 100644 --- a/src/nvim/api/options.c +++ b/src/nvim/api/options.c @@ -104,20 +104,20 @@ Object nvim_get_option_value(String name, Dict(option) *opts, Error *err) long numval = 0; char *stringval = NULL; - int result = access_option_value_for(name.data, &numval, &stringval, scope, opt_type, from, - true, err); + getoption_T result = access_option_value_for(name.data, &numval, &stringval, scope, opt_type, + from, true, err); if (ERROR_SET(err)) { return rv; } switch (result) { - case 0: + case gov_string: rv = STRING_OBJ(cstr_as_string(stringval)); break; - case 1: + case gov_number: rv = INTEGER_OBJ(numval); break; - case 2: + case gov_bool: switch (numval) { case 0: case 1: @@ -483,8 +483,8 @@ void set_option_to(uint64_t channel_id, void *to, int type, String name, Object }); } -static int access_option_value(char *key, long *numval, char **stringval, int opt_flags, bool get, - Error *err) +static getoption_T access_option_value(char *key, long *numval, char **stringval, int opt_flags, + bool get, Error *err) { if (get) { return get_option_value(key, numval, stringval, opt_flags); @@ -501,13 +501,13 @@ static int access_option_value(char *key, long *numval, char **stringval, int op } } -static int access_option_value_for(char *key, long *numval, char **stringval, int opt_flags, - int opt_type, void *from, bool get, Error *err) +static getoption_T access_option_value_for(char *key, long *numval, char **stringval, int opt_flags, + int opt_type, void *from, bool get, Error *err) { bool need_switch = false; switchwin_T switchwin; aco_save_T aco; - int result = 0; + getoption_T result = 0; try_start(); switch (opt_type) { |