Tuned the automatic preprocessor competion.

To only run if the pound/hash sign is at the start of the line.
This commit is contained in:
Erik Verbruggen
2010-05-19 14:09:43 +02:00
parent 148d232e88
commit b0cc9fa4e7

View File

@@ -636,6 +636,16 @@ bool CppCodeCompletion::triggersCompletion(TextEditor::ITextEditable *editor)
{
const int pos = editor->position();
if (startOfOperator(editor, pos, /*token =*/ 0, /*want function call=*/ true) != pos) {
if (m_completionOperator == T_POUND) {
if (TextEditor::BaseTextEditor *edit = qobject_cast<TextEditor::BaseTextEditor *>(editor->widget())) {
QTextCursor tc(edit->document());
tc.setPosition(pos);
return tc.columnNumber() == 1;
}
return false;
}
return true;
}