From 4809a9c2873978d471d0addbc647bb9288f975bb Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Mon, 28 Apr 2008 22:54:37 +1200 Subject: [PATCH] make sexy commenting fall back to normal commenting if sexy comments arent possible with the current filetype --- doc/NERD_commenter.txt | 2 ++ plugin/NERD_commenter.vim | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/NERD_commenter.txt b/doc/NERD_commenter.txt index 6b2b3b1..458afd7 100644 --- a/doc/NERD_commenter.txt +++ b/doc/NERD_commenter.txt @@ -871,6 +871,8 @@ to get illegal syntax when uncommenting them. - set the NERDRemoveExtraSpaces option to 1 by default as the doc states - fixed a bug where extra spaces werent being removed sometimes, thx to Zhang Shuhan for the report + - made the sexy comment mapping fall back to normal commenting if sexy + comments arent possible with the filetypes delimiters - fixed some other bugs with sexy comments 2.1.12 diff --git a/plugin/NERD_commenter.vim b/plugin/NERD_commenter.vim index 0f13b98..2bbabe4 100644 --- a/plugin/NERD_commenter.vim +++ b/plugin/NERD_commenter.vim @@ -1516,7 +1516,7 @@ function! NERDComment(isVisual, type) range try call s:CommentLinesSexy(firstLine, lastLine) catch /NERDCommenter.Delimiters/ - call s:NerdEcho("Sexy comments cannot be done with the available delimiters", 0) + call s:CommentLines(forceNested, 0, 0, firstLine, lastLine) catch /NERDCommenter.Nesting/ call s:NerdEcho("Sexy comment aborted. Nested sexy cannot be nested", 0) endtry