When we hit an exception, pass the line number of the top-of-stack

* This allows us to update the current line highlight before stopping.
This commit is contained in:
baldurk
2017-08-03 16:22:40 +01:00
parent 87ef595cce
commit ee67b85b58
5 changed files with 36 additions and 19 deletions
+5 -1
View File
@@ -569,7 +569,8 @@ void PythonShell::traceLine(const QString &file, int line)
scriptEditor->markerAdd(line > 0 ? line - 1 : 0, CURRENT_MARKER + 1);
}
void PythonShell::exception(const QString &type, const QString &value, QList<QString> frames)
void PythonShell::exception(const QString &type, const QString &value, int finalLine,
QList<QString> frames)
{
QTextEdit *out = ui->scriptOutput;
if(QObject::sender() == (QObject *)interactiveContext)
@@ -577,6 +578,9 @@ void PythonShell::exception(const QString &type, const QString &value, QList<QSt
QString exString;
if(finalLine >= 0)
traceLine(QString(), finalLine);
if(!out->toPlainText().endsWith(QLatin1Char('\n')))
exString = lit("\n");
if(!frames.isEmpty())