Commit b0cc9fa4 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Tuned the automatic preprocessor competion.

To only run if the pound/hash sign is at the start of the line.
parent 148d232e
......@@ -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;
}
......
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