[gnome-shell] runDialog: Let history trim input
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] runDialog: Let history trim input
- Date: Sat, 13 Feb 2021 09:01:23 +0000 (UTC)
commit df94055c58f312640a984ad7e94565850e0f458f
Author: Lucas Werkmeister <mail lucaswerkmeister de>
Date: Thu Feb 11 19:35:07 2021 +0100
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>
js/ui/runDialog.js | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js
index a01af5c9d5..bc9689d4d1 100644
--- a/js/ui/runDialog.js
+++ b/js/ui/runDialog.js
@@ -178,11 +178,9 @@ class RunDialog extends ModalDialog.ModalDialog {
}
_run(input, inTerminal) {
- input = input.trim();
+ input = this._history.addItem(input); // trims input
let command = input;
- if (input)
- this._history.addItem(input);
this._commandError = false;
let f;
if (this._enableInternalCommands)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]