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
Julian Ospald 1 year ago
parent
commit
6384ba8e36
No known key found for this signature in database
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
55 55
 function! neosnippet#variables#runtime_dir() abort
56 56
   " Set runtime dir.
57 57
   let runtime_dir = split(globpath(&runtimepath, 'neosnippets'), '\n')
58
-  if empty(runtime_dir) && empty(g:neosnippet#disable_runtime_snippets)
59
-    call neosnippet#util#print_error(
60
-          \ 'neosnippet default snippets cannot be loaded.')
61
-    call neosnippet#util#print_error(
62
-          \ 'You must install neosnippet-snippets or disable runtime snippets.')
63
-  endif
58
+
64 59
   if g:neosnippet#enable_snipmate_compatibility
65 60
     " Load snipMate snippet directories.
66 61
     let runtime_dir += split(globpath(&runtimepath,
@@ -70,6 +65,13 @@ function! neosnippet#variables#runtime_dir() abort
70 65
     endif
71 66
   endif
72 67
 
68
+  if empty(runtime_dir) && empty(g:neosnippet#disable_runtime_snippets)
69
+    call neosnippet#util#print_error(
70
+          \ 'neosnippet default snippets cannot be loaded.')
71
+    call neosnippet#util#print_error(
72
+          \ 'You must install neosnippet-snippets or disable runtime snippets.')
73
+  endif
74
+
73 75
   return map(runtime_dir, 'substitute(v:val, "[\\\\/]$", "", "")')
74 76
 endfunction
75 77
 function! neosnippet#variables#data_dir() abort