From 93cdbafd7fcf862e2205ec062a2d3733a58e1259 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Mon, 12 Mar 2012 10:24:38 +0000 Subject: [PATCH] fix repeat for visual-line comments this is still broken for visual and visual-block commenting --- plugin/NERD_commenter.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin/NERD_commenter.vim b/plugin/NERD_commenter.vim index 6afa6c5..e6660ce 100644 --- a/plugin/NERD_commenter.vim +++ b/plugin/NERD_commenter.vim @@ -1129,7 +1129,12 @@ function! NERDComment(mode, type) range let &ignorecase = oldIgnoreCase - silent! call repeat#set("\NERDCommenter". a:type) + if isVisual + let nlines = lastLine - firstLine + silent! call repeat#set("V" . nlines . "jo" . "\NERDCommenter". a:type) + else + silent! call repeat#set("\NERDCommenter". a:type) + endif endfunction " Function: s:PlaceDelimitersAndInsBetween() function {{{2