From d4f41d2697990507ff0d9aec5f36ee4a0b9a45e7 Mon Sep 17 00:00:00 2001 From: Sebastian Witte Date: Wed, 14 Jan 2015 18:13:35 +0100 Subject: [PATCH] Use state variable to determine whether the alternate delimiters have already been switched --- plugin/NERD_commenter.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/NERD_commenter.vim b/plugin/NERD_commenter.vim index 612a9e1..c47c572 100644 --- a/plugin/NERD_commenter.vim +++ b/plugin/NERD_commenter.vim @@ -463,8 +463,10 @@ function s:SetUpForNewFiletype(filetype, forceReset) endif endfor " if g:NERD__alt_style is defined, use the alternate style - if exists('g:NERD_'.ft.'_alt_style') && eval('g:NERD_'.ft.'_alt_style') + let b:NERDCommenterFirstInit = getbufvar(1,"NERDCommenterFirstInit",0) + if exists('g:NERD_'.ft.'_alt_style') && eval('g:NERD_'.ft.'_alt_style') && !b:NERDCommenterFirstInit call s:SwitchToAlternativeDelimiters(0) + let b:NERDCommenterFirstInit = 1 endif else let b:NERDCommenterDelims = s:CreateDelimMapFromCms()