nicer (un)comment selection, avoid C-style selections when you can do C++ style.

This commit is contained in:
mae
2008-12-11 13:35:58 +01:00
parent 6adb3f617e
commit ddfd46b322

View File

@@ -744,7 +744,8 @@ void CPPEditor::unCommentSelection()
QString endText = endBlock.text();
int endPos = end - endBlock.position();
bool hasTrailingCharacters = !endText.mid(endPos).trimmed().isEmpty();
bool hasTrailingCharacters = !endText.left(endPos).remove(QLatin1String("//")).trimmed().isEmpty()
&& !endText.mid(endPos).trimmed().isEmpty();
if ((endPos <= endText.length() - 2
&& endText.at(endPos) == QLatin1Char('*')
&& endText.at(endPos+1) == QLatin1Char('/'))) {