1
0
mirror of https://github.com/gryf/snipmate.vim.git synced 2025-12-21 05:18:01 +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
au FileType * call GetSnippets(g:snippets_dir)
let g:did_ft = {}
fun GetSnippets(dir)
for ft in split(&ft, '\.')
if !exists('g:did_ft_'.ft)
if !has_key(g:did_ft, ft)
if isdirectory(a:dir.ft)
call ExtractSnips(a:dir.ft, ft)
endif
@@ -36,7 +37,7 @@ fun GetSnippets(dir)
call ExtractSnipsFile(a:dir.ft.'.snippets')
endif
endif
let g:did_ft_{ft} = 1
let g:did_ft[ft] = 1
endfor
endf
" vim:noet:sw=4:ts=4:ft=vim

View File

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