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

Unified Diff: third_party/WebKit/Source/devtools/front_end/text_editor/TextEditorAutocompleteController.js

Issue 2387003004: DevTools: do not hide autocomplete for console prompt as user types. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/console/console-retain-autocomplete-on-typing-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/text_editor/TextEditorAutocompleteController.js
diff --git a/third_party/WebKit/Source/devtools/front_end/text_editor/TextEditorAutocompleteController.js b/third_party/WebKit/Source/devtools/front_end/text_editor/TextEditorAutocompleteController.js
index 02097a4f92a2f47332e55a0e23c9d2f676990fc0..190b164a7d3bbc7211c2cb5d49f9543edd618fea 100644
--- a/third_party/WebKit/Source/devtools/front_end/text_editor/TextEditorAutocompleteController.js
+++ b/third_party/WebKit/Source/devtools/front_end/text_editor/TextEditorAutocompleteController.js
@@ -403,18 +403,19 @@ WebInspector.TextEditorAutocompleteController.prototype = {
if (!this._suggestBox)
return;
var cursor = this._codeMirror.getCursor();
- // Hide autocomplete for smart braces.
+ var shouldCloseAutocomplete = !(cursor.line === this._prefixRange.startLine && this._prefixRange.startColumn <= cursor.ch && cursor.ch <= this._prefixRange.endColumn);
+ // Try not to hide autocomplete when user types in.
if (cursor.line === this._prefixRange.startLine && cursor.ch === this._prefixRange.endColumn + 1) {
var line = this._codeMirror.getLine(cursor.line);
- var isWordChar = this._config.isWordChar(line.charAt(cursor.ch - 1));
- if (!isWordChar)
- this.clearAutocomplete();
- return;
+ shouldCloseAutocomplete = this._config.isWordChar ? !this._config.isWordChar(line.charAt(cursor.ch - 1)) : false;
}
- if (cursor.line !== this._prefixRange.startLine || cursor.ch > this._prefixRange.endColumn || cursor.ch <= this._prefixRange.startColumn)
+ if (shouldCloseAutocomplete)
this.clearAutocomplete();
+ this._onCursorActivityHandledForTest();
},
+ _onCursorActivityHandledForTest: function() { },
+
_updateAnchorBox: function()
{
var line = this._prefixRange.startLine;
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/console/console-retain-autocomplete-on-typing-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698