aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-11-24 19:36:04 +0100
committerGitHub <noreply@github.com>2018-11-24 19:36:04 +0100
commit8b39e4ec793334be0e48101830f66e05691393bd (patch)
tree40d9b5b3fee2829baf8c3ab5fa38cf8d0629d7ce /src/nvim/buffer.c
parent108566e7b6f1b331dac8e339280c230bf39c137d (diff)
parent01dbf0951b25d582451a8e656731dcf3d9295a71 (diff)
downloadrneovim-8b39e4ec793334be0e48101830f66e05691393bd.tar.gz
rneovim-8b39e4ec793334be0e48101830f66e05691393bd.tar.bz2
rneovim-8b39e4ec793334be0e48101830f66e05691393bd.zip
Merge pull request #6920 from bfredl/namespace
make namespaces explicit (intitially for bufhl and virttext)
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index cd77f48320..634e257d40 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -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