Merge pull request #63 from vinsonchuong/fix-conceal-autocmd

Fix autocmd not firing for initial buffer
This commit is contained in:
Shougo 2012-10-28 02:53:28 -07:00
commit d74196b4fd

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