From e757f4d5363125e242f1e680d1f5bb53e8014b06 Mon Sep 17 00:00:00 2001 From: Timothy C Eichler Date: Sun, 15 Oct 2017 21:51:12 +0200 Subject: namespace: add ns_initialized func --- src/nvim/api/private/helpers.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/nvim/api/private/helpers.c') diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index 2056cb07e3..b54fc9207e 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -10,6 +10,7 @@ #include "nvim/api/private/helpers.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/handle.h" +#include "nvim/api/vim.h" #include "nvim/msgpack_rpc/helpers.h" #include "nvim/lua/executor.h" #include "nvim/ascii.h" @@ -1505,3 +1506,13 @@ ArrayOf(Dictionary) keymap_array(String mode, buf_T *buf) return mappings; } + + +// Is the Namespace in use? +bool ns_initialized(uint64_t ns) +{ + if (ns < 1) { + return false; + } + return ns < (uint64_t)next_namespace_id; +} -- cgit