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:
parent
d31f805817
commit
df94055c58
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user