forked from qt-creator/qt-creator
Debugger: Fix off-by-one line in tooltip context
The first function line (usually containing the function parameter) was attributed to the preceding function. Change-Id: Ia2b394cfa5a0edc909bc998bcce6bd92ae5b5b87 Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -282,7 +282,6 @@ QString cppExpressionAt(TextEditorWidget *editorWidget, int pos,
|
||||
int *line, int *column, QString *function,
|
||||
int *scopeFromLine, int *scopeToLine)
|
||||
{
|
||||
*line = *column = 0;
|
||||
if (function)
|
||||
function->clear();
|
||||
|
||||
@@ -297,13 +296,11 @@ QString cppExpressionAt(TextEditorWidget *editorWidget, int pos,
|
||||
// Fetch the expression's code.
|
||||
ExpressionUnderCursor expressionUnderCursor;
|
||||
expr = expressionUnderCursor(tc);
|
||||
*column = tc.positionInBlock();
|
||||
*line = tc.blockNumber();
|
||||
} else {
|
||||
*column = tc.positionInBlock();
|
||||
*line = tc.blockNumber();
|
||||
}
|
||||
|
||||
*column = tc.positionInBlock();
|
||||
*line = tc.blockNumber() + 1;
|
||||
|
||||
if (!expr.isEmpty()) {
|
||||
QString fileName = editorWidget->textDocument()->filePath().toString();
|
||||
const Snapshot snapshot = CppModelManager::instance()->snapshot();
|
||||
|
Reference in New Issue
Block a user