forked from qt-creator/qt-creator
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user