From 7052ba60f45dd73466a48764dde18e89a96c2d9d Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Tue, 17 Mar 2009 13:31:48 +1300 Subject: [PATCH] remove spaces from delimiters when using &commentstring --- plugin/NERD_commenter.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/NERD_commenter.vim b/plugin/NERD_commenter.vim index 5b2850f..f242b72 100644 --- a/plugin/NERD_commenter.vim +++ b/plugin/NERD_commenter.vim @@ -723,8 +723,8 @@ function s:SetUpForNewFiletype(filetype, forceReset) else "extract the delims from &commentstring - let left= substitute(&commentstring, '\(.*\)%s.*', '\1', '') - let right= substitute(&commentstring, '.*%s\(.*\)', '\1', 'g') + let left= substitute(&commentstring, '\([^ \t]*\)\s*%s.*', '\1', '') + let right= substitute(&commentstring, '.*%s\s*\(.*\)', '\1', 'g') call s:MapDelimiters(left,right) endif