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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user