diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-02-09 15:01:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-09 15:01:06 +0100 |
commit | 3ff1228f785705a46a0bd24fb5dc2bf76b6dad68 (patch) | |
tree | 508ff31d36dd2261ada88cdc9a126ca51438cd1a /src/nvim/api/private/helpers.c | |
parent | c9d01ff7db7b3ae7ecfcedbeae3e605996f4e214 (diff) | |
parent | 891ed14f13c3ea99d3fb985371c69f769ee7ff57 (diff) | |
download | rneovim-3ff1228f785705a46a0bd24fb5dc2bf76b6dad68.tar.gz rneovim-3ff1228f785705a46a0bd24fb5dc2bf76b6dad68.tar.bz2 rneovim-3ff1228f785705a46a0bd24fb5dc2bf76b6dad68.zip |
Merge pull request #9272 from bfredl/createbuf
api: add nvim_create_buf to create a new empty buffer.
Diffstat (limited to 'src/nvim/api/private/helpers.c')
-rw-r--r-- | src/nvim/api/private/helpers.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index 82c9a1da67..f5cac82315 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -27,6 +27,7 @@ #include "nvim/version.h" #include "nvim/lib/kvec.h" #include "nvim/getchar.h" +#include "nvim/fileio.h" #include "nvim/ui.h" /// Helper structure for vim_to_object @@ -1094,7 +1095,7 @@ static void set_option_value_for(char *key, { win_T *save_curwin = NULL; tabpage_T *save_curtab = NULL; - bufref_T save_curbuf = { NULL, 0, 0 }; + aco_save_T aco; try_start(); switch (opt_type) @@ -1115,9 +1116,9 @@ static void set_option_value_for(char *key, restore_win(save_curwin, save_curtab, true); break; case SREQ_BUF: - switch_buffer(&save_curbuf, (buf_T *)from); + aucmd_prepbuf(&aco, (buf_T *)from); set_option_value_err(key, numval, stringval, opt_flags, err); - restore_buffer(&save_curbuf); + aucmd_restbuf(&aco); break; case SREQ_GLOBAL: set_option_value_err(key, numval, stringval, opt_flags, err); |