api: allow nvim_buf_attach from lua using callbacks

This commit is contained in:
Björn Linse
2019-05-29 10:05:00 +02:00
parent 4841c46e33
commit f5c56f03bb
20 changed files with 301 additions and 59 deletions

View File

@@ -253,7 +253,8 @@ bool msgpack_rpc_to_object(const msgpack_object *const obj, Object *const arg)
case kObjectTypeFloat:
case kObjectTypeString:
case kObjectTypeArray:
case kObjectTypeDictionary: {
case kObjectTypeDictionary:
case kObjectTypeLuaRef: {
break;
}
}
@@ -387,6 +388,13 @@ void msgpack_rpc_from_object(const Object result, msgpack_packer *const res)
msgpack_pack_nil(res);
break;
}
case kObjectTypeLuaRef: {
// TODO(bfredl): could also be an error. Though kObjectTypeLuaRef
// should only appear when the caller has opted in to handle references,
// see nlua_pop_Object.
msgpack_pack_nil(res);
break;
}
case kObjectTypeBoolean: {
msgpack_rpc_from_boolean(cur.aobj->data.boolean, res);
break;