Fix autocmd not firing for initial buffer

This commit is contained in:
Vinson Chuong 2012-10-27 19:07:17 -07:00
parent 0a3edfa3a0
commit 5470da2546

View File

@ -73,27 +73,24 @@ function! s:initialize()"{{{
endfor endfor
call map(s:snippets_dir, 'substitute(v:val, "[\\\\/]$", "", "")') call map(s:snippets_dir, 'substitute(v:val, "[\\\\/]$", "", "")')
if has('conceal') augroup neosnippet
" Supported conceal features. autocmd BufNewFile,BufRead,ColorScheme *
augroup neosnippet \ execute 'syn match neosnippetExpandSnippets'
\ "'".s:get_placeholder_marker_pattern(). '\|'
\ .s:get_sync_placeholder_marker_pattern().'\|'
\ .s:get_mirror_placeholder_marker_pattern()."'"
\ 'containedin=ALL'
if has('conceal')
autocmd BufNewFile,BufRead,ColorScheme * autocmd BufNewFile,BufRead,ColorScheme *
\ syn match neosnippetExpandSnippets \ syn region neosnippetConcealExpandSnippets
\ '<`\d\+:\|`>\|<{\d\+:\|}>' conceal \ matchgroup=neosnippetExpandSnippets
autocmd BufNewFile,BufRead,ColorScheme * \ start='<`\d\+:\=\|<{\d\+:\=\|<|'
\ execute 'syn match neosnippetExpandSnippets' \ end='`>\|}>\||>'
\ '''<`\d\+\\\@<!`>\|<{\d\+\\\@<!}>\|' \ containedin=ALL
\ .s:get_mirror_placeholder_marker_pattern()."'" \ concealends
\ 'conceal cchar=$' endif
augroup END augroup END
else doautocmd neosnippet BufRead
augroup neosnippet
autocmd BufNewFile,BufRead,ColorScheme *
\ execute 'syn match neosnippetExpandSnippets'
\ "'".s:get_placeholder_marker_pattern(). '\|'
\ .s:get_sync_placeholder_marker_pattern().'\|'
\ .s:get_mirror_placeholder_marker_pattern()."'"
augroup END
endif
hi def link neosnippetExpandSnippets Special hi def link neosnippetExpandSnippets Special