forked from qt-creator/qt-creator
Fixed handling of text wrapping and a text layout corner case
Due to using QTextCursor::columnNumber() instead of QTextCursor::positionInBlock(), a lot of code would not work correctly when used with wrapped lines. In addition, there was an issue with columnNumber() returning 0 right after inserting a character before the last character of a line. Reviewed-by: mae
This commit is contained in:
@@ -747,11 +747,11 @@ QString cppExpressionAt(TextEditor::ITextEditor *editor, int pos,
|
||||
// Fetch the expression's code.
|
||||
CPlusPlus::ExpressionUnderCursor expressionUnderCursor;
|
||||
expr = expressionUnderCursor(tc);
|
||||
*column = tc.columnNumber();
|
||||
*column = tc.positionInBlock();
|
||||
*line = tc.blockNumber();
|
||||
} else {
|
||||
const QTextCursor tc = plaintext->textCursor();
|
||||
*column = tc.columnNumber();
|
||||
*column = tc.positionInBlock();
|
||||
*line = tc.blockNumber();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user