Commit a1a565b9 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Two more columnNumber() calls that should be positionInBlock()

columnNumber() relies on text wrapping, and we're only interested in the
position of the cursor in the block.
parent e1a0f5ab
......@@ -51,7 +51,7 @@ public:
{}
QList<AST *> operator()(const QTextCursor &cursor)
{ return this->operator()(cursor.blockNumber(), cursor.columnNumber()); }
{ return this->operator()(cursor.blockNumber(), cursor.positionInBlock()); }
/// line and column are 0-based!
QList<AST *> operator()(int line, int column);
......
......@@ -640,7 +640,7 @@ bool CppCodeCompletion::triggersCompletion(TextEditor::ITextEditable *editor)
if (TextEditor::BaseTextEditor *edit = qobject_cast<TextEditor::BaseTextEditor *>(editor->widget())) {
QTextCursor tc(edit->document());
tc.setPosition(pos);
return tc.columnNumber() == 1;
return tc.positionInBlock() == 1;
}
return false;
......
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