mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 05:48:26 +00:00
Bug 619910 - Misplaced autocomplete suggestions when typing a command in a new line; f=mihai.sucan r=gavin.sharp approval2.0=gavin.sharp
This commit is contained in:
parent
137495a7a9
commit
ae12ad1158
@ -4505,7 +4505,8 @@ JSTerm.prototype = {
|
||||
{
|
||||
this.completionValue = suffix;
|
||||
|
||||
let prefix = new Array(this.inputNode.value.length + 1).join(" ");
|
||||
// completion prefix = input, with non-control chars replaced by spaces
|
||||
let prefix = this.inputNode.value.replace(/[\S]/g, " ");
|
||||
this.completeNode.value = prefix + this.completionValue;
|
||||
},
|
||||
};
|
||||
|
@ -100,6 +100,11 @@ function testCompletion() {
|
||||
jsterm.execute();
|
||||
is(jsterm.completeNode.value, "", "clear completion on execute()");
|
||||
|
||||
// Test multi-line completion works
|
||||
input.value = "console.log('one');\nconsol";
|
||||
jsterm.complete(jsterm.COMPLETE_HINT_ONLY);
|
||||
is(jsterm.completeNode.value, " \n e", "multi-line completion");
|
||||
|
||||
HUD = jsterm = input = null;
|
||||
finishTest();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user