diff --git a/doc/NERD_commenter.txt b/doc/NERD_commenter.txt index ffc1fe9..5de6ed8 100644 --- a/doc/NERD_commenter.txt +++ b/doc/NERD_commenter.txt @@ -875,6 +875,7 @@ to get illegal syntax when uncommenting them. comments arent possible with the filetypes delimiters - fixed some other bugs with sexy comments - made toggle commenting slightly more robust + - fixed a bug with single line compact sexy comments 2.1.12 - added support for patran and dakota, thx to Jacobo Diaz for the email diff --git a/plugin/NERD_commenter.vim b/plugin/NERD_commenter.vim index ac08536..c4eaca2 100644 --- a/plugin/NERD_commenter.vim +++ b/plugin/NERD_commenter.vim @@ -1284,12 +1284,14 @@ function s:CommentLinesSexy(topline, bottomline) call setline(a:topline, theLine) "comment the bottom line - let theLine = getline(a:bottomline) - let lineHasTabs = s:HasLeadingTabs(theLine) - if lineHasTabs - let theLine = s:ConvertLeadingTabsToSpaces(theLine) + if a:bottomline != a:topline + let theLine = getline(a:bottomline) + let lineHasTabs = s:HasLeadingTabs(theLine) + if lineHasTabs + let theLine = s:ConvertLeadingTabsToSpaces(theLine) + endif + let theLine = s:SwapOutterMultiPartDelimsForPlaceHolders(theLine) endif - let theLine = s:SwapOutterMultiPartDelimsForPlaceHolders(theLine) let theLine = s:AddRightDelim(spaceString . right, theLine) if lineHasTabs let theLine = s:ConvertLeadingSpacesToTabs(theLine)