diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-05-12 08:17:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-12 08:17:21 +0200 |
commit | 36b2e3f743aaeb27531e67079d1a20bb4ac75e35 (patch) | |
tree | 75063f22b1a90605b6f2aee0233729eaf06306b4 /src/nvim/api/vim.c | |
parent | 273d2cd5d5cfc7616c76d3531e9938750abcc05e (diff) | |
parent | 137eedb4edab1643b47282cce4ca07dd2ee42a63 (diff) | |
download | rneovim-36b2e3f743aaeb27531e67079d1a20bb4ac75e35.tar.gz rneovim-36b2e3f743aaeb27531e67079d1a20bb4ac75e35.tar.bz2 rneovim-36b2e3f743aaeb27531e67079d1a20bb4ac75e35.zip |
Merge #8375 'API: nvim_get_commands'
closes #7833
ref #8029
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r-- | src/nvim/api/vim.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index df4912a51e..7a951d4e67 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -948,17 +948,32 @@ Dictionary nvim_get_mode(void) return rv; } -/// Gets a list of dictionaries describing global (non-buffer) mappings. -/// The "buffer" key in the returned dictionary is always zero. +/// Gets a list of global (non-buffer-local) |mapping| definitions. /// /// @param mode Mode short-name ("n", "i", "v", ...) -/// @returns Array of maparg()-like dictionaries describing mappings +/// @returns Array of maparg()-like dictionaries describing mappings. +/// The "buffer" key is always zero. ArrayOf(Dictionary) nvim_get_keymap(String mode) - FUNC_API_SINCE(3) + FUNC_API_SINCE(3) { return keymap_array(mode, NULL); } +/// Gets a map of global (non-buffer-local) Ex commands. +/// +/// Currently only |user-commands| are supported, not builtin Ex commands. +/// +/// @param opts Optional parameters. Currently only supports +/// {"builtin":false} +/// @param[out] err Error details, if any. +/// +/// @returns Map of maps describing commands. +Dictionary nvim_get_commands(Dictionary opts, Error *err) + FUNC_API_SINCE(4) +{ + return nvim_buf_get_commands(-1, opts, err); +} + /// Returns a 2-tuple (Array), where item 0 is the current channel id and item /// 1 is the |api-metadata| map (Dictionary). /// |