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;
|
||||
const SimpleToken tk = tokenUnderCursor(cursor);
|
||||
|
||||
if (tk.isComment())
|
||||
return false;
|
||||
if (tk.isComment()) {
|
||||
const int pos = cursor.selectionEnd();
|
||||
|
||||
if (pos < tk.end())
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user