From 3b462a3f8693f13eca6e5798f3fdd4d916a095e9 Mon Sep 17 00:00:00 2001 From: Andrew Radev Date: Fri, 31 Dec 2021 12:13:00 +0200 Subject: [PATCH] Reset nvim namespaces only in neovim --- plugin/crates.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/crates.vim b/plugin/crates.vim index 50fd153..4ba1a88 100644 --- a/plugin/crates.vim +++ b/plugin/crates.vim @@ -254,8 +254,10 @@ function! crates#up() abort let line = substitute(line, '"\zs[0-9\.\*]\+\ze"', vers_latest, '') endif call setline(lnum, line) - call nvim_buf_clear_namespace(bufnr(''), nvim_create_namespace('crates'), - \ line('.')-1, line('.')) + if has('nvim') + call nvim_buf_clear_namespace(bufnr(''), nvim_create_namespace('crates'), + \ line('.')-1, line('.')) + endif endfunction function! s:setup() abort