forked from qt-creator/qt-creator
nicer (un)comment selection, avoid C-style selections when you can do C++ style.
This commit is contained in:
@@ -744,7 +744,8 @@ void CPPEditor::unCommentSelection()
|
|||||||
|
|
||||||
QString endText = endBlock.text();
|
QString endText = endBlock.text();
|
||||||
int endPos = end - endBlock.position();
|
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
|
if ((endPos <= endText.length() - 2
|
||||||
&& endText.at(endPos) == QLatin1Char('*')
|
&& endText.at(endPos) == QLatin1Char('*')
|
||||||
&& endText.at(endPos+1) == QLatin1Char('/'))) {
|
&& endText.at(endPos+1) == QLatin1Char('/'))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user