From 5470da25466c43353ba3134243b4d37585da096b Mon Sep 17 00:00:00 2001 From: Vinson Chuong Date: Sat, 27 Oct 2012 19:07:17 -0700 Subject: [PATCH] Fix autocmd not firing for initial buffer --- autoload/neosnippet.vim | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index fcbf9bd..38fe585 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -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