diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2016-06-19 21:06:03 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2016-08-31 21:40:20 +0200 |
commit | a2d25b7bf81728d913e7b317d33997c8b8268af2 (patch) | |
tree | 35a9a81aa16a7e0756a8d438207c7af0b53478b3 /scripts/gendispatch.lua | |
parent | 3bd3b3b76859b3eef80fa4969147efa881b60f40 (diff) | |
download | rneovim-a2d25b7bf81728d913e7b317d33997c8b8268af2.tar.gz rneovim-a2d25b7bf81728d913e7b317d33997c8b8268af2.tar.bz2 rneovim-a2d25b7bf81728d913e7b317d33997c8b8268af2.zip |
api: unify buffer numbers and window ids with handles
also allow handle==0 meaning curbuf/curwin/curtab
Diffstat (limited to 'scripts/gendispatch.lua')
-rw-r--r-- | scripts/gendispatch.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/gendispatch.lua b/scripts/gendispatch.lua index ce1d8be222..9178996a56 100644 --- a/scripts/gendispatch.lua +++ b/scripts/gendispatch.lua @@ -193,9 +193,9 @@ for i = 1, #functions do output:write('\n if (args.items['..(j - 1)..'].type == kObjectType'..rt..') {') output:write('\n '..converted..' = args.items['..(j - 1)..'].data.'..rt:lower()..';') if rt:match('^Buffer$') or rt:match('^Window$') or rt:match('^Tabpage$') or rt:match('^Boolean$') then - -- accept positive integers for Buffers, Windows and Tabpages - output:write('\n } else if (args.items['..(j - 1)..'].type == kObjectTypeInteger && args.items['..(j - 1)..'].data.integer > 0) {') - output:write('\n '..converted..' = (unsigned)args.items['..(j - 1)..'].data.integer;') + -- accept nonnegative integers for Booleans, Buffers, Windows and Tabpages + output:write('\n } else if (args.items['..(j - 1)..'].type == kObjectTypeInteger && args.items['..(j - 1)..'].data.integer >= 0) {') + output:write('\n '..converted..' = (handle_T)args.items['..(j - 1)..'].data.integer;') end output:write('\n } else {') output:write('\n snprintf(error->msg, sizeof(error->msg), "Wrong type for argument '..j..', expecting '..param[1]..'");') |