1
0
mirror of https://github.com/gryf/snipmate.vim.git synced 2025-12-30 02:12:35 +01:00

bugfix: dont source file based snippets more than once

Set the s:did_<filetype> flag after reading in
file based snippets. This prevents snippets getting read in more than
once.

Move the code that checks for file based snippets out of
after/plugin/snipMate.vim and into plugin/snipMate.vim. Refactor this
code into functions for readability.

Signed-off-by: meese <msanders42@gmail.com>
This commit is contained in:
Martin Grenfell
2009-02-27 18:03:58 +08:00
committed by meese
parent dd4836d2b2
commit b5999ba5cc
2 changed files with 17 additions and 11 deletions

View File

@@ -11,14 +11,3 @@ snor <bs> b<bs>
snor ' b<bs>'
snor <right> <esc>a
snor <left> <esc>bi
" By default load snippets in ~/.vim/snippets/<filetype>
" NOTE: I need to make sure this works on Windows
if isdirectory($HOME.'/.vim/snippets')
if isdirectory($HOME.'/.vim/snippets/_')
call ExtractSnips($HOME.'/.vim/snippets/_', '_')
endif
au FileType * if !exists('s:did_'.&ft) &&
\ isdirectory($HOME.'/.vim/snippets/'.&ft)
\| cal ExtractSnips($HOME.'/.vim/snippets/'.&ft, &ft) | en
endif