Merge pull request #16871 from bfredl/luaperf

perf(api): elide luaref copy when setting 'callback' in nvim_set_keymap
This commit is contained in:
Björn Linse 2022-01-01 17:21:26 +01:00 committed by GitHub
commit 273b5c9282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -606,7 +606,8 @@ void modify_keymap(Buffer buffer, bool is_unmap, String mode, String lhs, String
}
if (opts != NULL && opts->callback.type == kObjectTypeLuaRef) {
lua_funcref = api_new_luaref(opts->callback.data.luaref);
lua_funcref = opts->callback.data.luaref;
opts->callback.data.luaref = LUA_NOREF;
}
MapArguments parsed_args = MAP_ARGUMENTS_INIT;
if (opts) {