Commit 4843f44c authored by Roberto Raggi's avatar Roberto Raggi
Browse files

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

parent 5df7b967
...@@ -1435,8 +1435,12 @@ bool CPPEditor::contextAllowsAutoParentheses(const QTextCursor &cursor) const ...@@ -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;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment