From 25b630484023716977c3fe2790c13b41f9db9f30 Mon Sep 17 00:00:00 2001 From: Nimit Bhardwaj Date: Sat, 24 Feb 2018 15:44:51 +0530 Subject: API: nvim_get_commands() --- src/nvim/api/private/helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/api/private/helpers.c') diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index b922036893..03f1a882d3 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -701,7 +701,7 @@ String cchar_to_string(char c) String cstr_to_string(const char *str) { if (str == NULL) { - return (String) STRING_INIT; + return (String) STRING_INIT; } size_t len = strlen(str); @@ -1149,7 +1149,7 @@ void api_set_error(Error *err, ErrorType errType, const char *format, ...) /// /// @param mode The abbreviation for the mode /// @param buf The buffer to get the mapping array. NULL for global -/// @returns An array of maparg() like dictionaries describing mappings +/// @returns Array of maparg()-like dictionaries describing mappings ArrayOf(Dictionary) keymap_array(String mode, buf_T *buf) { Array mappings = ARRAY_DICT_INIT; -- cgit From 9fa7727ce047e8e2e13f9fbf60d5defe9cf45060 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 10 May 2018 23:37:56 +0200 Subject: API: nvim_get_commands(): always return keys - Always return all keys, with at least NIL value. - Require `opts` param to be {"builtin":false} - Validate `opts` param --- src/nvim/api/private/helpers.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/nvim/api/private/helpers.c') diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index 03f1a882d3..17ee3ed711 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -685,7 +685,7 @@ tabpage_T *find_tab_by_handle(Tabpage tabpage, Error *err) String cchar_to_string(char c) { char buf[] = { c, NUL }; - return (String) { + return (String){ .data = xmemdupz(buf, 1), .size = (c != NUL) ? 1 : 0 }; @@ -701,13 +701,13 @@ String cchar_to_string(char c) String cstr_to_string(const char *str) { if (str == NULL) { - return (String) STRING_INIT; + return (String)STRING_INIT; } size_t len = strlen(str); - return (String) { - .data = xmemdupz(str, len), - .size = len + return (String){ + .data = xmemdupz(str, len), + .size = len, }; } @@ -722,7 +722,7 @@ String cstr_to_string(const char *str) String cbuf_to_string(const char *buf, size_t size) FUNC_ATTR_NONNULL_ALL { - return (String) { + return (String){ .data = xmemdupz(buf, size), .size = size }; @@ -737,9 +737,9 @@ String cbuf_to_string(const char *buf, size_t size) String cstr_as_string(char *str) FUNC_ATTR_PURE { if (str == NULL) { - return (String) STRING_INIT; + return (String)STRING_INIT; } - return (String) { .data = str, .size = strlen(str) }; + return (String){ .data = str, .size = strlen(str) }; } /// Converts from type Object to a VimL value. -- cgit