Commit cf11bcbf authored by Thomas Friedrichsmeier's avatar Thomas Friedrichsmeier
Browse files

Properly unset EDITOR env var, instead of setting it as empty.

(An empty EDITOR env var causes misbehavior in R, and possibly elsewhere.)
parent adc5315b
......@@ -54,9 +54,17 @@ KateKonsolePlugin::KateKonsolePlugin(QObject *parent, const QList<QVariant> &)
}
}
void setEditorEnv(const QByteArray& value) {
if (value.isNull()) {
qunsetenv("EDITOR");
} else {
qputenv("EDITOR", value.data());
}
}
KateKonsolePlugin::~KateKonsolePlugin()
{
qputenv("EDITOR", m_previousEditorEnv.data());
setEditorEnv(m_previousEditorEnv);
}
QObject *KateKonsolePlugin::createView(KTextEditor::MainWindow *mainWindow)
......@@ -412,7 +420,7 @@ void KateConsole::readConfig()
if (KConfigGroup(KSharedConfig::openConfig(), "Konsole").readEntry("SetEditor", false))
qputenv("EDITOR", "kate -b");
else
qputenv("EDITOR", m_plugin->previousEditorEnv().data());
setEditorEnv(m_plugin->previousEditorEnv());
}
KateKonsoleConfigPage::KateKonsoleConfigPage(QWidget *parent, KateKonsolePlugin *plugin)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment