IDEA-135341 Uncomment action removes a space after a comment prefix which ends with a space.

This commit is contained in:
Dmitry Batrak
2015-01-21 10:55:58 +03:00
parent fb3c168fc5
commit 24da6d9cb5
@@ -555,13 +555,6 @@ public class CommentByLineCommentHandler extends MultiCaretCodeInsightActionHand
assert commented;
int charsToDelete = matchesTrimmed ? prefix.trim().length() : prefix.length();
int theEnd = endOffset > 0 ? endOffset : chars.length();
// if there's exactly one space after line comment prefix and before the text that follows in the same line, delete the space too
if (startOffset + charsToDelete < theEnd - 1 && chars.charAt(startOffset + charsToDelete) == ' ') {
if (startOffset + charsToDelete == theEnd - 2 || chars.charAt(startOffset + charsToDelete + 1) != ' ') {
charsToDelete++;
}
}
document.deleteString(startOffset, startOffset + charsToDelete);
return true;
}