diff options
author | w0rp <w0rp@users.noreply.github.com> | 2018-11-25 14:05:39 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-25 14:05:39 +0000 |
commit | 51b6fa4aa21e4d2be7b0ea6b78ee251f71dd89c8 (patch) | |
tree | d55163633373a4c5131b122955e04b998558ff16 | |
parent | 2ab64514d02576b929ce3e7123fc45b6a148891a (diff) | |
parent | 6746cb333332d309232a884261fe3229fdc24e44 (diff) | |
download | ale-51b6fa4aa21e4d2be7b0ea6b78ee251f71dd89c8.zip |
Merge pull request #2103 from bfredl/ns
Don't hardcode the namespace id for virtual text
-rw-r--r-- | autoload/ale/virtualtext.vim | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/autoload/ale/virtualtext.vim b/autoload/ale/virtualtext.vim index a2f88a3a..c4ce37dd 100644 --- a/autoload/ale/virtualtext.vim +++ b/autoload/ale/virtualtext.vim @@ -8,6 +8,10 @@ let g:ale_virtualtext_delay = get(g:, 'ale_virtualtext_delay', 10) let s:cursor_timer = -1 let s:last_pos = [0, 0, 0] +if has('nvim-0.3.2') + let s:ns_id = nvim_create_namespace('ale') +endif + if !hlexists('ALEVirtualTextError') highlight link ALEVirtualTextError ALEError endif @@ -35,7 +39,7 @@ function! ale#virtualtext#Clear() abort let l:buffer = bufnr('') - call nvim_buf_clear_highlight(l:buffer, 1000, 0, -1) + call nvim_buf_clear_highlight(l:buffer, s:ns_id, 0, -1) endfunction function! ale#virtualtext#ShowMessage(message, hl_group) abort @@ -48,7 +52,7 @@ function! ale#virtualtext#ShowMessage(message, hl_group) abort let l:buffer = bufnr('') let l:prefix = get(g:, 'ale_virtualtext_prefix', '> ') - call nvim_buf_set_virtual_text(l:buffer, 1000, l:line-1, [[l:prefix.a:message, a:hl_group]], {}) + call nvim_buf_set_virtual_text(l:buffer, s:ns_id, l:line-1, [[l:prefix.a:message, a:hl_group]], {}) endfunction function! s:StopCursorTimer() abort |