diff options
-rw-r--r-- | autoload/sonictemplate.vim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/autoload/sonictemplate.vim b/autoload/sonictemplate.vim index eafb233..274775b 100644 --- a/autoload/sonictemplate.vim +++ b/autoload/sonictemplate.vim @@ -38,6 +38,9 @@ function! sonictemplate#complete(lead, cmdline, curpos) abort endfor endif endif + for tmpldir in s:tmpldir + let tmp += map(split(globpath(join([tmpldir, '_'], '/'), (search('[^ \t]', 'wn') ? 'snip-' : 'base-') . a:lead . '*.*'), "\n"), 'fnamemodify(v:val, ":t:r")[5:]') + endfor let candidate = [] for c in tmp if index(candidate, c) == -1 @@ -60,6 +63,9 @@ function! sonictemplate#apply(name, mode) abort let fsl = split(globpath(join([tmpldir, ft], '/'), (search('[^ \t]', 'wn') ? 'snip-' : 'base-') . name . '.*'), "\n") endif endif + if len(fsl) == 0 + let fsl = split(globpath(join([tmpldir, '_'], '/'), (search('[^ \t]', 'wn') ? 'snip-' : 'base-') . name . '.*'), "\n") + endif let fs += fsl endfor if len(fs) == 0 |