mirror of
https://github.com/gryf/snipmate.vim.git
synced 2025-12-20 12:58:05 +01:00
added support for automatic loading of snippets in hyphened files & directories
This commit is contained in:
@@ -106,14 +106,13 @@ endf
|
||||
let g:did_ft = {}
|
||||
fun! GetSnippets(dir)
|
||||
for ft in split(&ft, '\.')
|
||||
if !has_key(g:did_ft, ft)
|
||||
if isdirectory(a:dir.ft)
|
||||
call ExtractSnips(a:dir.ft, ft)
|
||||
endif
|
||||
if filereadable(a:dir.ft.'.snippets')
|
||||
call ExtractSnipsFile(a:dir.ft.'.snippets')
|
||||
endif
|
||||
endif
|
||||
if has_key(g:did_ft, ft) | continue | endif
|
||||
for path in split(globpath(a:dir, ft.'\(-*\)\=/'), '\n')
|
||||
call ExtractSnips(path, ft)
|
||||
endfor
|
||||
for path in split(globpath(a:dir, ft.'\(-*\)\=.snippets'), '\n')
|
||||
call ExtractSnipsFile(path)
|
||||
endfor
|
||||
let g:did_ft[ft] = 1
|
||||
endfor
|
||||
endf
|
||||
|
||||
Reference in New Issue
Block a user