Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(961)

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js

Issue 1875273002: [DevTools] Introduce a setting for console autocomplete from history. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js b/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
index 79952d39399ba6e6c3af2f170cbf80c20f98ee92..d90672fced3670fae7295660bc0d04a639da6081 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
@@ -814,6 +814,8 @@ WebInspector.TextPromptWithHistory = function(completions, stopCharacters)
* @type {number}
*/
this._historyOffset = 1;
+
+ this._addCompletionsFromHistory = true;
}
WebInspector.TextPromptWithHistory.prototype = {
@@ -833,7 +835,7 @@ WebInspector.TextPromptWithHistory.prototype = {
*/
additionalCompletions: function(prefix)
{
- if (!this.isCaretAtEndOfPrompt())
+ if (!this._addCompletionsFromHistory || !this.isCaretAtEndOfPrompt())
return [];
var result = [];
var text = this.text();
@@ -860,6 +862,14 @@ WebInspector.TextPromptWithHistory.prototype = {
},
/**
+ * @param {boolean} value
+ */
+ setAddCompletionsFromHistory: function(value)
+ {
+ this._addCompletionsFromHistory = value;
+ },
+
+ /**
* Pushes a committed text into the history.
* @param {string} text
*/

Powered by Google App Engine
This is Rietveld 408576698