namespace: add ns_initialized func

This commit is contained in:
Timothy C Eichler 2017-10-15 21:51:12 +02:00 committed by Björn Linse
parent b9c9283f72
commit e757f4d536
1 changed files with 11 additions and 0 deletions

View File

@ -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;
}