Mercurial > vim
comparison src/option.c @ 14301:3c80092eb211 v8.1.0166
patch 8.1.0166: using dict_add_nr_str() is clumsy
commit https://github.com/vim/vim/commit/e0be167a805fd547c25ec1ec97fd4c7f13046236
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 8 16:50:37 2018 +0200
patch 8.1.0166: using dict_add_nr_str() is clumsy
Problem: Using dict_add_nr_str() is clumsy.
Solution: Split into two functions. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/3154)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 08 Jul 2018 17:00:07 +0200 |
parents | fbf0681606fa |
children | 37ed47b58f54 |
comparison
equal
deleted
inserted
replaced
14300:7a0639d9fdc8 | 14301:3c80092eb211 |
---|---|
13220 char_u *varp = get_varp(opt); | 13220 char_u *varp = get_varp(opt); |
13221 | 13221 |
13222 if (varp != NULL) | 13222 if (varp != NULL) |
13223 { | 13223 { |
13224 if (opt->flags & P_STRING) | 13224 if (opt->flags & P_STRING) |
13225 dict_add_nr_str(d, opt->fullname, 0L, *(char_u **)varp); | 13225 dict_add_string(d, opt->fullname, *(char_u **)varp); |
13226 else if (opt->flags & P_NUM) | 13226 else if (opt->flags & P_NUM) |
13227 dict_add_nr_str(d, opt->fullname, *(long *)varp, NULL); | 13227 dict_add_number(d, opt->fullname, *(long *)varp); |
13228 else | 13228 else |
13229 dict_add_nr_str(d, opt->fullname, *(int *)varp, NULL); | 13229 dict_add_number(d, opt->fullname, *(int *)varp); |
13230 } | 13230 } |
13231 } | 13231 } |
13232 } | 13232 } |
13233 | 13233 |
13234 return d; | 13234 return d; |