mirror of
https://github.com/gryf/snipmate.vim.git
synced 2025-12-20 21:08:01 +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 = {}
|
let g:did_ft = {}
|
||||||
fun! GetSnippets(dir)
|
fun! GetSnippets(dir)
|
||||||
for ft in split(&ft, '\.')
|
for ft in split(&ft, '\.')
|
||||||
if !has_key(g:did_ft, ft)
|
if has_key(g:did_ft, ft) | continue | endif
|
||||||
if isdirectory(a:dir.ft)
|
for path in split(globpath(a:dir, ft.'\(-*\)\=/'), '\n')
|
||||||
call ExtractSnips(a:dir.ft, ft)
|
call ExtractSnips(path, ft)
|
||||||
endif
|
endfor
|
||||||
if filereadable(a:dir.ft.'.snippets')
|
for path in split(globpath(a:dir, ft.'\(-*\)\=.snippets'), '\n')
|
||||||
call ExtractSnipsFile(a:dir.ft.'.snippets')
|
call ExtractSnipsFile(path)
|
||||||
endif
|
endfor
|
||||||
endif
|
|
||||||
let g:did_ft[ft] = 1
|
let g:did_ft[ft] = 1
|
||||||
endfor
|
endfor
|
||||||
endf
|
endf
|
||||||
|
|||||||
Reference in New Issue
Block a user