Index: Source/devtools/front_end/ui/TextPrompt.js |
diff --git a/Source/devtools/front_end/ui/TextPrompt.js b/Source/devtools/front_end/ui/TextPrompt.js |
index 909135022016ab3b25485686c0f8caa72dbb4c29..f0281ede9ac5c1270d8c38bd9893723486b58c68 100644 |
--- a/Source/devtools/front_end/ui/TextPrompt.js |
+++ b/Source/devtools/front_end/ui/TextPrompt.js |
@@ -472,12 +472,12 @@ WebInspector.TextPrompt.prototype = { |
this._commonPrefix = this._buildCommonPrefix(completions, wordPrefixLength); |
if (this.isCaretAtEndOfPrompt()) { |
+ var completionText = completions[selectedIndex]; |
+ var prefixText = this._userEnteredRange.toString(); |
+ var suffixText = completionText.substring(wordPrefixLength); |
this._userEnteredRange.deleteContents(); |
this._element.normalize(); |
var finalSelectionRange = document.createRange(); |
- var completionText = completions[selectedIndex]; |
- var prefixText = completionText.substring(0, wordPrefixLength); |
- var suffixText = completionText.substring(wordPrefixLength); |
var prefixTextNode = document.createTextNode(prefixText); |
fullWordRange.insertNode(prefixTextNode); |