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
1 changed files with 17 additions and 20 deletions

View File

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