diff options
author | Matthieu Coudron <mcoudron@hotmail.com> | 2021-01-30 23:08:19 +0100 |
---|---|---|
committer | Matthieu Coudron <mcoudron@hotmail.com> | 2021-02-02 15:40:08 +0100 |
commit | bb22c780445b2e62dc5e3a76e553020351c2de20 (patch) | |
tree | 8de903c61a2710e35881f9a8392c2dbfebfd014b /src | |
parent | 3f81f5c7a451f93a48103af4f1c31fd5f31d687f (diff) | |
download | rneovim-bb22c780445b2e62dc5e3a76e553020351c2de20.tar.gz rneovim-bb22c780445b2e62dc5e3a76e553020351c2de20.tar.bz2 rneovim-bb22c780445b2e62dc5e3a76e553020351c2de20.zip |
api: add nvim_notify
parameters are mandatory
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/api/vim.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 09895a2119..b94c99dc5e 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -545,6 +545,26 @@ Object nvim_exec_lua(String code, Array args, Error *err) return nlua_exec(code, args, err); } +/// Notify the user with a message +/// +/// Relays the call to vim.notify . By default forwards your message in the +/// echo area but can be overriden to trigger desktop notifications. +/// +/// @param msg Message to display to the user +/// @param log_level The log level +/// @param opts Reserved for future use. +/// @param[out] err Error details, if any +Object nvim_notify(String msg, Integer log_level, Dictionary opts, Error *err) + FUNC_API_SINCE(7) +{ + FIXED_TEMP_ARRAY(args, 3); + args.items[0] = STRING_OBJ(msg); + args.items[1] = INTEGER_OBJ(log_level); + args.items[2] = DICTIONARY_OBJ(opts); + + return nlua_exec(STATIC_CSTR_AS_STRING("return vim.notify(...)"), args, err); +} + /// Calls a VimL function. /// /// @param fn Function name |