mirror of
https://github.com/neovim/neovim.git
synced 2025-09-08 12:28:18 +00:00
api: implement object namespaces
Namespaces is a lightweight concept that should be used to group objects for purposes of bulk operations and introspection. This is initially used for highlights and virtual text in buffers, and is planned to also be used for extended marks. There is no plan use them for privileges or isolation, neither to introduce nanespace-level options.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
|
||||
#include "nvim/api/private/handle.h"
|
||||
#include "nvim/api/private/helpers.h"
|
||||
#include "nvim/api/vim.h"
|
||||
#include "nvim/ascii.h"
|
||||
#include "nvim/assert.h"
|
||||
#include "nvim/vim.h"
|
||||
@@ -5327,10 +5328,10 @@ int bufhl_add_hl(buf_T *buf,
|
||||
int hl_id,
|
||||
linenr_T lnum,
|
||||
colnr_T col_start,
|
||||
colnr_T col_end) {
|
||||
static int next_src_id = 1;
|
||||
colnr_T col_end)
|
||||
{
|
||||
if (src_id == 0) {
|
||||
src_id = next_src_id++;
|
||||
src_id = (int)nvim_create_namespace((String)STRING_INIT);
|
||||
}
|
||||
if (hl_id <= 0) {
|
||||
// no highlight group or invalid line, just return src_id
|
||||
|
Reference in New Issue
Block a user