forked from qt-creator/qt-creator
QmlProfiler: Don't try to open editor at line 0
There is no line 0, so if the document is already open, the editor won't move to the beginning. Use line 1 instead, so that we jump to the location of the corresponding text mark. Change-Id: I0c5605d2d48b02d73dd97ddc87a527cf1b5dba8f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -458,9 +458,9 @@ void QmlProfilerTool::gotoSourceLocation(const QString &fileUrl, int lineNumber,
|
|||||||
|
|
||||||
// The text editors count columns starting with 0, but the ASTs store the
|
// The text editors count columns starting with 0, but the ASTs store the
|
||||||
// location starting with 1, therefore the -1.
|
// location starting with 1, therefore the -1.
|
||||||
EditorManager::openEditorAt(projectFileName, lineNumber, columnNumber - 1, Id(),
|
EditorManager::openEditorAt(
|
||||||
EditorManager::DoNotSwitchToDesignMode
|
projectFileName, lineNumber == 0 ? 1 : lineNumber, columnNumber - 1, Id(),
|
||||||
| EditorManager::DoNotSwitchToEditMode);
|
EditorManager::DoNotSwitchToDesignMode | EditorManager::DoNotSwitchToEditMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlProfilerTool::updateTimeDisplay()
|
void QmlProfilerTool::updateTimeDisplay()
|
||||||
|
|||||||
Reference in New Issue
Block a user