lookingGlass: Fix newline replacing

text.replace() returns the new string as strings in JS are immutable.
This commit is contained in:
Jasper St. Pierre 2013-09-11 00:38:38 -04:00
parent 954d262d67
commit 9ba970b83d

View File

@ -920,7 +920,7 @@ const LookingGlass = new Lang.Class({
let text = o.get_text(); let text = o.get_text();
// Ensure we don't get newlines in the command; the history file is // Ensure we don't get newlines in the command; the history file is
// newline-separated. // newline-separated.
text.replace('\n', ' '); text = text.replace('\n', ' ');
// Strip leading and trailing whitespace // Strip leading and trailing whitespace
text = text.replace(/^\s+/g, '').replace(/\s+$/g, ''); text = text.replace(/^\s+/g, '').replace(/\s+$/g, '');
if (text == '') if (text == '')