1
0
mirror of https://github.com/gryf/snipmate.vim.git synced 2025-12-21 13:28:05 +01:00

made it so ResetSnippets() resets g:did_ft as well

This commit is contained in:
Michael Sanders
2009-03-24 14:20:52 -04:00
parent 84321bbe17
commit 1e8fe57222
2 changed files with 4 additions and 3 deletions

View File

@@ -26,9 +26,10 @@ if filereadable(snippets_dir.'_.snippets')
endif endif
au FileType * call GetSnippets(g:snippets_dir) au FileType * call GetSnippets(g:snippets_dir)
let g:did_ft = {}
fun GetSnippets(dir) fun GetSnippets(dir)
for ft in split(&ft, '\.') for ft in split(&ft, '\.')
if !exists('g:did_ft_'.ft) if !has_key(g:did_ft, ft)
if isdirectory(a:dir.ft) if isdirectory(a:dir.ft)
call ExtractSnips(a:dir.ft, ft) call ExtractSnips(a:dir.ft, ft)
endif endif
@@ -36,7 +37,7 @@ fun GetSnippets(dir)
call ExtractSnipsFile(a:dir.ft.'.snippets') call ExtractSnipsFile(a:dir.ft.'.snippets')
endif endif
endif endif
let g:did_ft_{ft} = 1 let g:did_ft[ft] = 1
endfor endfor
endf endf
" vim:noet:sw=4:ts=4:ft=vim " vim:noet:sw=4:ts=4:ft=vim

View File

@@ -104,7 +104,7 @@ fun! ExtractSnipsFile(file)
endf endf
fun! ResetSnippets() fun! ResetSnippets()
let s:snippets = {} | let s:multi_snips = {} let s:snippets = {} | let s:multi_snips = {} | let g:did_ft = {}
endf endf
fun s:RemoveSnippet() fun s:RemoveSnippet()