aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/window.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-09-12 11:24:01 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-09-12 13:50:07 -0300
commit545acf2024ea2653ae6937d570a37aa0340caa5e (patch)
tree7440aa48e60919082e235ea0ff1a550ba1904d5c /src/nvim/api/window.c
parentcd2e46c0785d40b9ea15f6d722a3fad54c007b9b (diff)
downloadrneovim-545acf2024ea2653ae6937d570a37aa0340caa5e.tar.gz
rneovim-545acf2024ea2653ae6937d570a37aa0340caa5e.tar.bz2
rneovim-545acf2024ea2653ae6937d570a37aa0340caa5e.zip
api metadata: Allow typed container information in api functions
Adapt gendeclarations.lua/msgpack-gen.lua to allow the `ArrayOf(...)` and `DictionaryOf(...)` types in function headers. These are simple macros that expand to Array and Dictionary respectively, but the information is kept in the metadata object, which is useful for building clients in statically typed languages.
Diffstat (limited to 'src/nvim/api/window.c')
-rw-r--r--src/nvim/api/window.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c
index 967d8acda4..dd256f2b6d 100644
--- a/src/nvim/api/window.c
+++ b/src/nvim/api/window.c
@@ -33,7 +33,7 @@ Buffer window_get_buffer(Window window, Error *err)
/// @param window The window handle
/// @param[out] err Details of an error that may have occurred
/// @return the (row, col) tuple
-Array window_get_cursor(Window window, Error *err)
+ArrayOf(Integer, 2) window_get_cursor(Window window, Error *err)
{
Array rv = ARRAY_DICT_INIT;
win_T *win = find_window_by_handle(window, err);
@@ -51,7 +51,7 @@ Array window_get_cursor(Window window, Error *err)
/// @param window The window handle
/// @param pos the (row, col) tuple representing the new position
/// @param[out] err Details of an error that may have occurred
-void window_set_cursor(Window window, Array pos, Error *err)
+void window_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err)
{
win_T *win = find_window_by_handle(window, err);
@@ -247,7 +247,7 @@ void window_set_option(Window window, String name, Object value, Error *err)
/// @param window The window handle
/// @param[out] err Details of an error that may have occurred
/// @return The (row, col) tuple with the window position
-Array window_get_position(Window window, Error *err)
+ArrayOf(Integer, 2) window_get_position(Window window, Error *err)
{
Array rv = ARRAY_DICT_INIT;
win_T *win = find_window_by_handle(window, err);