aboutsummaryrefslogtreecommitdiff
path: root/src/api/vim.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-05-08 18:48:40 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-05-13 09:33:41 -0300
commit7c01d5ff9286d262097484c680e3a4eab49e2911 (patch)
tree17c4402f90638019525612720216cdc444ced5ef /src/api/vim.c
parent5f5e39323ee799def35adde7cfee06698c2dfcc8 (diff)
downloadrneovim-7c01d5ff9286d262097484c680e3a4eab49e2911.tar.gz
rneovim-7c01d5ff9286d262097484c680e3a4eab49e2911.tar.bz2
rneovim-7c01d5ff9286d262097484c680e3a4eab49e2911.zip
API: Implement vim_{get,set}_var
Diffstat (limited to 'src/api/vim.c')
-rw-r--r--src/api/vim.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/api/vim.c b/src/api/vim.c
index efe37d9e9a..93654da91f 100644
--- a/src/api/vim.c
+++ b/src/api/vim.c
@@ -127,14 +127,16 @@ void vim_set_current_line(Object line, Error *err)
buffer_set_line(curbuf->b_fnum, curwin->w_cursor.lnum - 1, line, err);
}
-Object vim_get_var(bool special, String name, Error *err)
+Object vim_get_var(bool special, String name, bool pop, Error *err)
{
- abort();
+ return dict_get_value(special ? &vimvardict : &globvardict, name,
+ special ? false : pop,
+ err);
}
-void vim_set_var(bool special, String name, Object value, Error *err)
+Object vim_set_var(String name, Object value, Error *err)
{
- abort();
+ return dict_set_value(&globvardict, name, value, err);
}
String vim_get_option(String name, Error *err)