diff options
author | Josh Rahm <rahm@google.com> | 2022-07-18 19:37:18 +0000 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2022-07-18 19:37:18 +0000 |
commit | 308e1940dcd64aa6c344c403d4f9e0dda58d9c5c (patch) | |
tree | 35fe43e01755e0f312650667004487a44d6b7941 /src/nvim/context.c | |
parent | 96a00c7c588b2f38a2424aeeb4ea3581d370bf2d (diff) | |
parent | e8c94697bcbe23a5c7b07c292b90a6b70aadfa87 (diff) | |
download | rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.tar.gz rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.tar.bz2 rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.zip |
Merge remote-tracking branch 'upstream/master' into rahm
Diffstat (limited to 'src/nvim/context.c')
-rw-r--r-- | src/nvim/context.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/context.c b/src/nvim/context.c index 614a3ce30e..db26667009 100644 --- a/src/nvim/context.c +++ b/src/nvim/context.c @@ -33,6 +33,7 @@ void ctx_free_all(void) /// Returns the size of the context stack. size_t ctx_size(void) + FUNC_ATTR_PURE { return kv_size(ctx_stack); } @@ -40,6 +41,7 @@ size_t ctx_size(void) /// Returns pointer to Context object with given zero-based index from the top /// of context stack or NULL if index is out of bounds. Context *ctx_get(size_t index) + FUNC_ATTR_PURE { if (index < kv_size(ctx_stack)) { return &kv_Z(ctx_stack, index); @@ -127,7 +129,7 @@ bool ctx_restore(Context *ctx, const int flags) free_ctx = true; } - char_u *op_shada; + char *op_shada; get_option_value("shada", NULL, &op_shada, OPT_GLOBAL); set_option_value("shada", 0L, "!,'100,%", OPT_GLOBAL); @@ -155,7 +157,7 @@ bool ctx_restore(Context *ctx, const int flags) ctx_free(ctx); } - set_option_value("shada", 0L, (char *)op_shada, OPT_GLOBAL); + set_option_value("shada", 0L, op_shada, OPT_GLOBAL); xfree(op_shada); return true; @@ -256,7 +258,8 @@ static inline void ctx_save_funcs(Context *ctx, bool scriptonly) size_t cmd_len = sizeof("func! ") + STRLEN(name); char *cmd = xmalloc(cmd_len); snprintf(cmd, cmd_len, "func! %s", name); - String func_body = nvim_exec(cstr_as_string(cmd), true, &err); + String func_body = nvim_exec(VIML_INTERNAL_CALL, cstr_as_string(cmd), + true, &err); xfree(cmd); if (!ERROR_SET(&err)) { ADD(ctx->funcs, STRING_OBJ(func_body)); |