From 875ced11011bd6245c28c6094fde51724f428b2c Mon Sep 17 00:00:00 2001 From: Michael Sanders Date: Thu, 26 Mar 2009 01:05:12 -0400 Subject: [PATCH] added support for automatic loading of snippets in hyphened files & directories --- plugin/snipMate.vim | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/plugin/snipMate.vim b/plugin/snipMate.vim index 790c041..c6f6b8c 100644 --- a/plugin/snipMate.vim +++ b/plugin/snipMate.vim @@ -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