runDialog: Let history trim input

Checking whether the item is empty is now the history’s job, per the
previous commit. The history also returns the trimmed input for us, so
we can avoid doing that work twice.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1653>
This commit is contained in:
Lucas Werkmeister 2021-02-11 19:35:07 +01:00 committed by Marge Bot
parent d31f805817
commit df94055c58

View File

@ -178,11 +178,9 @@ class RunDialog extends ModalDialog.ModalDialog {
} }
_run(input, inTerminal) { _run(input, inTerminal) {
input = input.trim(); input = this._history.addItem(input); // trims input
let command = input; let command = input;
if (input)
this._history.addItem(input);
this._commandError = false; this._commandError = false;
let f; let f;
if (this._enableInternalCommands) if (this._enableInternalCommands)