Browse Source

Fix warning about default snippets

Don't ignore runtime_dir, which is added in case
snipmate compatibility is set.

Fixes https://github.com/Shougo/neosnippet.vim/issues/432
PR/fix-warning
Julian Ospald 2 years ago
parent
commit
6384ba8e36
Signed by: hasufell <hasufell@hasufell.de> GPG Key ID: 511B62C09D50CD28
1 changed files with 8 additions and 6 deletions
  1. +8
    -6
      autoload/neosnippet/variables.vim

+ 8
- 6
autoload/neosnippet/variables.vim View File

@@ -55,12 +55,7 @@ endfunction
function! neosnippet#variables#runtime_dir() abort
" Set runtime dir.
let runtime_dir = split(globpath(&runtimepath, 'neosnippets'), '\n')
if empty(runtime_dir) && empty(g:neosnippet#disable_runtime_snippets)
call neosnippet#util#print_error(
\ 'neosnippet default snippets cannot be loaded.')
call neosnippet#util#print_error(
\ 'You must install neosnippet-snippets or disable runtime snippets.')
endif

if g:neosnippet#enable_snipmate_compatibility
" Load snipMate snippet directories.
let runtime_dir += split(globpath(&runtimepath,
@@ -70,6 +65,13 @@ function! neosnippet#variables#runtime_dir() abort
endif
endif

if empty(runtime_dir) && empty(g:neosnippet#disable_runtime_snippets)
call neosnippet#util#print_error(
\ 'neosnippet default snippets cannot be loaded.')
call neosnippet#util#print_error(
\ 'You must install neosnippet-snippets or disable runtime snippets.')
endif

return map(runtime_dir, 'substitute(v:val, "[\\\\/]$", "", "")')
endfunction
function! neosnippet#variables#data_dir() abort


Loading…
Cancel
Save