diff options
-rw-r--r-- | runtime/autoload/remote/host.vim | 5 | ||||
-rw-r--r-- | src/nvim/memory.c | 17 | ||||
-rw-r--r-- | test/functional/helpers.lua | 1 | ||||
-rw-r--r-- | third-party/CMakeLists.txt | 2 |
4 files changed, 17 insertions, 8 deletions
diff --git a/runtime/autoload/remote/host.vim b/runtime/autoload/remote/host.vim index 54a8bb3c41..e81aa81665 100644 --- a/runtime/autoload/remote/host.vim +++ b/runtime/autoload/remote/host.vim @@ -121,6 +121,11 @@ function! s:RegistrationCommands(host) call remote#host#RegisterClone(host_id, a:host) let pattern = s:plugin_patterns[a:host] let paths = globpath(&rtp, 'rplugin/'.a:host.'/'.pattern, 0, 1) + if len(paths) < 1 + echom "Could not find any plugins when attempting to register plugin " + \ ."commands. See :he remote-plugin" + return [] + endif for path in paths call remote#host#RegisterPlugin(host_id, path, []) endfor diff --git a/src/nvim/memory.c b/src/nvim/memory.c index c2c406a235..f305c4628f 100644 --- a/src/nvim/memory.c +++ b/src/nvim/memory.c @@ -49,11 +49,11 @@ static void try_to_free_memory(void) /// @return pointer to allocated space. NULL if out of memory void *try_malloc(size_t size) FUNC_ATTR_MALLOC FUNC_ATTR_ALLOC_SIZE(1) { - size = size ? size : 1; - void *ret = malloc(size); + size_t allocated_size = size ? size : 1; + void *ret = malloc(allocated_size); if (!ret) { try_to_free_memory(); - ret = malloc(size); + ret = malloc(allocated_size); } return ret; } @@ -102,10 +102,12 @@ void *xmalloc(size_t size) void *xcalloc(size_t count, size_t size) FUNC_ATTR_MALLOC FUNC_ATTR_ALLOC_SIZE_PROD(1, 2) FUNC_ATTR_NONNULL_RET { - void *ret = count && size ? calloc(count, size) : calloc(1, 1); + size_t allocated_count = count && size ? count : 1; + size_t allocated_size = count && size ? size : 1; + void *ret = calloc(allocated_count, allocated_size); if (!ret) { try_to_free_memory(); - ret = count && size ? calloc(count, size) : calloc(1, 1); + ret = calloc(allocated_count, allocated_size); if (!ret) { OUT_STR(e_outofmem); out_char('\n'); @@ -123,10 +125,11 @@ void *xcalloc(size_t count, size_t size) void *xrealloc(void *ptr, size_t size) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_ALLOC_SIZE(2) FUNC_ATTR_NONNULL_RET { - void *ret = size ? realloc(ptr, size) : realloc(ptr, 1); + size_t allocated_size = size ? size : 1; + void *ret = realloc(ptr, allocated_size); if (!ret) { try_to_free_memory(); - ret = size ? realloc(ptr, size) : realloc(ptr, 1); + ret = realloc(ptr, allocated_size); if (!ret) { OUT_STR(e_outofmem); out_char('\n'); diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 27d8493a12..b758817b41 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -161,6 +161,7 @@ end local function clear() if session then session:request('vim_command', 'qa!') + session._async_session._msgpack_stream._loop:exit() end local loop = Loop.new() local msgpack_stream = MsgpackStream.new(loop) diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index 38c5533ddd..39bd31896e 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -194,7 +194,7 @@ if(USE_BUNDLED_LUAROCKS) add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/nvim-client COMMAND ${DEPS_BIN_DIR}/luarocks - ARGS build https://raw.githubusercontent.com/neovim/lua-client/master/nvim-client-0.0.1-2.rockspec CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER} LIBUV_DIR=${DEPS_INSTALL_DIR} + ARGS build https://raw.githubusercontent.com/neovim/lua-client/0aefb79d8f60fd180594f376d20144414e1f37a4/nvim-client-0.0.1-3.rockspec CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER} LIBUV_DIR=${DEPS_INSTALL_DIR} DEPENDS lpeg libuv) add_custom_target(nvim-client DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/nvim-client) |