File Metadata

Author
sirgienko
Created
Mar 25 2018, 3:05 PM

octavefix.patch

diff --git a/src/backends/octave/octavesession.cpp b/src/backends/octave/octavesession.cpp
index 55700b2..7d6b43c 100644
--- a/src/backends/octave/octavesession.cpp
+++ b/src/backends/octave/octavesession.cpp
@@ -100,7 +100,7 @@ void OctaveSession::login()
m_process->start();
m_process->waitForStarted();
m_process->waitForReadyRead();
- qDebug()<<m_process->readAllStandardOutput();
+ //qDebug()<<m_process->readAllStandardOutput();
connect ( m_process, SIGNAL ( readyReadStandardOutput() ), SLOT ( readOutput() ) );
connect ( m_process, SIGNAL ( readyReadStandardError() ), SLOT ( readError() ) );
@@ -227,8 +227,6 @@ void OctaveSession::readOutput()
}
QString line = QString::fromLocal8Bit(m_process->readLine());
qDebug()<<"start parsing " << " " << line;
- if (!m_currentExpression)
- {
if (m_prompt.isEmpty() && line.contains(QLatin1String(":1>")))
{
qDebug() << "Found Octave prompt:" << line;
@@ -252,7 +250,6 @@ void OctaveSession::readOutput()
m_watch->addDir(m_tempDir, KDirWatch::WatchFiles);
}
}
- }
else if (line.contains(m_prompt))
{
// Check for errors before finalizing the expression
diff --git a/src/worksheet.cpp b/src/worksheet.cpp
index ebe28a1..1c7d713 100644
--- a/src/worksheet.cpp
+++ b/src/worksheet.cpp
@@ -762,6 +762,8 @@ void Worksheet::enableHighlighting(bool highlight)
{
if(m_highlighter)
m_highlighter->deleteLater();
+ if (!m_loginDone && m_session->backend()->name() == QLatin1String("Octave"))
+ loginToSession();
m_highlighter=session()->syntaxHighlighter(this);
if(!m_highlighter)
m_highlighter=new Cantor::DefaultHighlighter(this);