Don't allow auto parentheses when the token under cursor is a comment.

This commit is contained in:
Roberto Raggi
2009-09-18 12:27:04 +02:00
parent 5df7b96735
commit 4843f44c30

View File

@@ -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()) {
const int pos = cursor.selectionEnd();
if (pos < tk.end())
return false; return false;
}
return true; return true;
} }