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

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

Issue 2764003002: DevTools: Do not apply first suggestion in the classes pane on enter (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/elements/ClassesPaneWidget.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 483
484 if (query + selectionRange.toString() !== fullWordRange.toString()) 484 if (query + selectionRange.toString() !== fullWordRange.toString())
485 return; 485 return;
486 486
487 var beforeRange = this._createRange(); 487 var beforeRange = this._createRange();
488 beforeRange.setStart(this._element, 0); 488 beforeRange.setStart(this._element, 0);
489 beforeRange.setEnd(fullWordRange.startContainer, fullWordRange.startOffset); 489 beforeRange.setEnd(fullWordRange.startContainer, fullWordRange.startOffset);
490 this._queryRange = new Common.TextRange( 490 this._queryRange = new Common.TextRange(
491 0, beforeRange.toString().length, 0, beforeRange.toString().length + ful lWordRange.toString().length); 491 0, beforeRange.toString().length, 0, beforeRange.toString().length + ful lWordRange.toString().length);
492 492
493 var shouldSelect = !this._disableDefaultSuggestionForEmptyInput || this.text (); 493 var shouldSelect = !this._disableDefaultSuggestionForEmptyInput || !!this.te xt();
kdzwinel 2017/03/21 12:32:38 not really related, but I found it while investiga
einbinder 2017/03/21 23:30:08 Good catch! I never trust that booleans in devtool
494 if (this._suggestBox) { 494 if (this._suggestBox) {
495 this._suggestBox.updateSuggestions( 495 this._suggestBox.updateSuggestions(
496 this._boxForAnchorAtStart(selection, fullWordRange), completions, shou ldSelect, !this._isCaretAtEndOfPrompt(), 496 this._boxForAnchorAtStart(selection, fullWordRange), completions, shou ldSelect, !this._isCaretAtEndOfPrompt(),
497 this.text()); 497 this.text());
498 } 498 }
499 } 499 }
500 500
501 /** 501 /**
502 * @override 502 * @override
503 * @param {string} suggestion 503 * @param {string} suggestion
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 */ 634 */
635 proxyElementForTests() { 635 proxyElementForTests() {
636 return this._proxyElement || null; 636 return this._proxyElement || null;
637 } 637 }
638 }; 638 };
639 639
640 UI.TextPrompt.DefaultAutocompletionTimeout = 250; 640 UI.TextPrompt.DefaultAutocompletionTimeout = 250;
641 641
642 /** @implements {Common.Emittable} */ 642 /** @implements {Common.Emittable} */
643 UI.TextPrompt.TextChangedEvent = class {}; 643 UI.TextPrompt.TextChangedEvent = class {};
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/elements/ClassesPaneWidget.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698