From fbe3bd3c3533d4ed94511c4f41374472f2bd9602 Mon Sep 17 00:00:00 2001 From: svermeulen Date: Sat, 25 May 2013 15:31:00 -0300 Subject: [PATCH] Exposed function to check whether a line is commented --- plugin/NERD_commenter.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin/NERD_commenter.vim b/plugin/NERD_commenter.vim index 13c7693..25521ad 100644 --- a/plugin/NERD_commenter.vim +++ b/plugin/NERD_commenter.vim @@ -1035,6 +1035,11 @@ function s:InvertComment(firstLine, lastLine) endwhile endfunction +function! NERDCommentIsLineCommented(lineNo) + let theLine = getline(a:lineNo) + return s:IsInSexyComment(a:lineNo) || s:IsCommentedFromStartOfLine(s:Left(), theLine) || s:IsCommentedFromStartOfLine(s:Left({'alt': 1}), theLine) +endfunction + " Function: NERDComment(mode, type) function {{{2 " This function is a Wrapper for the main commenting functions "