aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/vim.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-10-28 23:14:15 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-10-28 23:14:15 -0400
commit72c54db443aad66dd5f71ce25d7ec8896715e233 (patch)
treebb13b201a2934a8a5a3bb60f3f1025fbf2707ac9 /src/nvim/api/vim.c
parentc28adf15e6c2079c732bb77fb99c50b80a4d7fe2 (diff)
parent250298884bb0c86847131cb872dcc9865115f8eb (diff)
downloadrneovim-72c54db443aad66dd5f71ce25d7ec8896715e233.tar.gz
rneovim-72c54db443aad66dd5f71ce25d7ec8896715e233.tar.bz2
rneovim-72c54db443aad66dd5f71ce25d7ec8896715e233.zip
Merge #1342 "signs bugfix"
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r--src/nvim/api/vim.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index c90e7039ce..9afefd6fa3 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -96,6 +96,19 @@ String vim_replace_termcodes(String str, Boolean from_part, Boolean do_lt,
return cstr_as_string(ptr);
}
+String vim_command_output(String str, Error *err)
+{
+ do_cmdline_cmd((char_u *)"redir => v:command_output");
+ vim_command(str, err);
+ do_cmdline_cmd((char_u *)"redir END");
+
+ if (err->set) {
+ return (String) STRING_INIT;
+ }
+
+ return cstr_to_string((char *)get_vim_var_str(VV_COMMAND_OUTPUT));
+}
+
/// Evaluates the expression str using the vim internal expression
/// evaluator (see |expression|).
/// Dictionaries and lists are recursively expanded.