Changeset 187902 in webkit


Ignore:
Timestamp:
Aug 4, 2015, 3:48:42 PM (10 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Existing text after completions do not have their completion style removed once hint is applied
https://bugs.webkit.org/show_bug.cgi?id=147536

Reviewed by Timothy Hatcher.

No longer applies a class to the text after the completion hint.

  • UserInterface/Controllers/CodeMirrorCompletionController.css:

(.CodeMirror .CodeMirror-lines .completion-hint):

  • UserInterface/Controllers/CodeMirrorCompletionController.js:

(WebInspector.CodeMirrorCompletionController.prototype._applyCompletionHint.update):
(WebInspector.CodeMirrorCompletionController.prototype._applyCompletionHint):
(WebInspector.CodeMirrorCompletionController.prototype._removeCompletionHint.clearMarker):
(WebInspector.CodeMirrorCompletionController.prototype._removeCompletionHint.update):
(WebInspector.CodeMirrorCompletionController.prototype._removeCompletionHint):

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r187900 r187902  
     12015-08-04  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Existing text after completions do not have their completion style removed once hint is applied
     4        https://bugs.webkit.org/show_bug.cgi?id=147536
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        No longer applies a class to the text after the completion hint.
     9
     10        * UserInterface/Controllers/CodeMirrorCompletionController.css:
     11        (.CodeMirror .CodeMirror-lines .completion-hint):
     12        * UserInterface/Controllers/CodeMirrorCompletionController.js:
     13        (WebInspector.CodeMirrorCompletionController.prototype._applyCompletionHint.update):
     14        (WebInspector.CodeMirrorCompletionController.prototype._applyCompletionHint):
     15        (WebInspector.CodeMirrorCompletionController.prototype._removeCompletionHint.clearMarker):
     16        (WebInspector.CodeMirrorCompletionController.prototype._removeCompletionHint.update):
     17        (WebInspector.CodeMirrorCompletionController.prototype._removeCompletionHint):
     18
    1192015-08-04  Matt Baker  <mattbaker@apple.com>
    220
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.css

    r164543 r187902  
    2525
    2626.CodeMirror .CodeMirror-lines .completion-hint {
     27    text-decoration: none !important;
    2728    opacity: 0.4;
    2829}
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js

    r187708 r187902  
    271271            var from = {line: this._lineNumber, ch: this._startOffset};
    272272            var cursor = {line: this._lineNumber, ch: this._endOffset};
    273             var to = {line: this._lineNumber, ch: this._startOffset + replacementText.length};
    274273            var currentText = this._codeMirror.getRange(from, cursor);
    275274
    276275            this._createCompletionHintMarker(cursor, replacementText.replace(currentText, ""));
    277             if (cursor.ch !== to.ch)
    278                 this._codeMirror.markText(cursor, to, {className: WebInspector.CodeMirrorCompletionController.CompletionHintStyleClassName});
    279276        }
    280277
     
    343340        this._notifyCompletionsHiddenSoon();
    344341
     342        function clearMarker(marker)
     343        {
     344            if (!marker)
     345                return;
     346
     347            var range = marker.find();
     348            if (range)
     349                marker.clear();
     350
     351            return null;
     352        }
     353
    345354        function update()
    346355        {
    347             var range = this._completionHintMarker.find();
    348             if (range)
    349                 this._completionHintMarker.clear();
    350 
    351             this._completionHintMarker = null;
     356            this._completionHintMarker = clearMarker(this._completionHintMarker);
    352357
    353358            if (dontRestorePrefix)
Note: See TracChangeset for help on using the changeset viewer.