Commit b1ec23bc authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[KRunner] Don't add to history items that start with a space

This mimics shell prompt behavior.

BUG: 392762
FIXED-IN: 5.13.0

Differential Revision: https://phabricator.kde.org/D11985
parent dbe9a53d
......@@ -354,6 +354,10 @@ QStringList View::history() const
void View::addToHistory(const QString &item)
{
if (item.isEmpty()) {
return;
}
if (item == QLatin1String("SESSIONS")) {
return;
}
......@@ -362,6 +366,11 @@ void View::addToHistory(const QString &item)
return;
}
// Mimic shell behavior of not storing lines starting with a space
if (item.at(0).isSpace()) {
return;
}
m_history.removeOne(item);
m_history.prepend(item);
......
Supports Markdown
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