forked from qt-creator/qt-creator
Don't allow auto parentheses when the token under cursor is a comment.
This commit is contained in:
@@ -1435,8 +1435,12 @@ bool CPPEditor::contextAllowsAutoParentheses(const QTextCursor &cursor) const
|
|||||||
CPlusPlus::TokenUnderCursor tokenUnderCursor;
|
CPlusPlus::TokenUnderCursor tokenUnderCursor;
|
||||||
const SimpleToken tk = tokenUnderCursor(cursor);
|
const SimpleToken tk = tokenUnderCursor(cursor);
|
||||||
|
|
||||||
if (tk.isComment())
|
if (tk.isComment()) {
|
||||||
return false;
|
const int pos = cursor.selectionEnd();
|
||||||
|
|
||||||
|
if (pos < tk.end())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user