diff options
author | Famiu Haque <famiuhaque@proton.me> | 2023-06-07 06:05:16 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-07 08:05:16 +0800 |
commit | b3d5138fd0066fda26ef7724a542ae45eb42fc84 (patch) | |
tree | f9893af238d838408c81c6d4e36655865fe465b0 /src/nvim/api/vim.c | |
parent | 0370e4def0c0328f8cd09f02c1ca82ed491ecb9a (diff) | |
download | rneovim-b3d5138fd0066fda26ef7724a542ae45eb42fc84.tar.gz rneovim-b3d5138fd0066fda26ef7724a542ae45eb42fc84.tar.bz2 rneovim-b3d5138fd0066fda26ef7724a542ae45eb42fc84.zip |
refactor(options): remove `getoption_T` and introduce `OptVal` (#23850)
Removes the `getoption_T` struct and also introduces the `OptVal` struct
to unify the methods of getting/setting different option value types.
This is the first of many PRs to reduce code duplication in the Vim
option code as well as to make options easier to maintain. It also
increases the flexibility and extensibility of options. Which opens the
door for things like Array and Dictionary options.
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r-- | src/nvim/api/vim.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 4722195fe4..d93af6a2a4 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -910,10 +910,10 @@ Buffer nvim_create_buf(Boolean listed, Boolean scratch, Error *err) if (scratch) { aco_save_T aco; aucmd_prepbuf(&aco, buf); - set_option_value("bufhidden", 0L, "hide", OPT_LOCAL); - set_option_value("buftype", 0L, "nofile", OPT_LOCAL); - set_option_value("swapfile", 0L, NULL, OPT_LOCAL); - set_option_value("modeline", 0L, NULL, OPT_LOCAL); // 'nomodeline' + set_option_value("bufhidden", STATIC_CSTR_AS_OPTVAL("hide"), OPT_LOCAL); + set_option_value("buftype", STATIC_CSTR_AS_OPTVAL("nofile"), OPT_LOCAL); + set_option_value("swapfile", BOOLEAN_OPTVAL(false), OPT_LOCAL); + set_option_value("modeline", BOOLEAN_OPTVAL(false), OPT_LOCAL); // 'nomodeline' aucmd_restbuf(&aco); } return buf->b_fnum; |