Changeset 207481 in webkit
- Timestamp:
- Oct 18, 2016 1:21:02 PM (8 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r207473 r207481 1 2016-10-18 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: CSS Autocompletion sometimes adds extra unexpected characters 4 https://bugs.webkit.org/show_bug.cgi?id=163612 5 <rdar://problem/28829557> 6 7 Reviewed by Timothy Hatcher. 8 9 * UserInterface/Controllers/CodeMirrorCompletionController.js: 10 (WebInspector.CodeMirrorCompletionController.prototype._generateCSSCompletions): 11 Better handle completions in cases where we are in the middle of a property 12 to avoid orphaned characters, or at the end of a function name to avoid creating 13 duplicate parenthesis. 14 1 15 2016-10-18 Joseph Pecoraro <pecoraro@apple.com> 2 16 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js
r206015 r207481 538 538 return []; 539 539 540 // Don't complete in the middle of a property name. 541 if (/^[a-z]/i.test(suffix)) 542 return []; 543 540 544 var token = mainToken; 541 545 var lineNumber = this._lineNumber; … … 562 566 563 567 // If there is a suffix and it isn't a semicolon, then we should use a space since 564 // the user is editing in the middle. 565 this._implicitSuffix = suffix && suffix !== ";" ? " " : (this._noEndingSemicolon ? "" : ";"); 568 // the user is editing in the middle. Likewise if the suffix starts with an open 569 // paren we are changing a function name so don't add a suffix. 570 this._implicitSuffix = " "; 571 if (suffix === ";") 572 this._implicitSuffix = this._noEndingSemicolon ? "" : ";"; 573 else if (suffix.startsWith("(")) 574 this._implicitSuffix = ""; 566 575 567 576 // Don't use an implicit suffix if it would be the same as the existing suffix. … … 569 578 this._implicitSuffix = ""; 570 579 571 return WebInspector.CSSKeywordCompletions.forProperty(propertyName).startsWith(this._prefix); 580 let completions = WebInspector.CSSKeywordCompletions.forProperty(propertyName).startsWith(this._prefix); 581 582 if (suffix.startsWith("(")) 583 completions = completions.map((x) => x.replace(/\(\)$/, "")); 584 585 return completions; 572 586 } 573 587
Note: See TracChangeset
for help on using the changeset viewer.