Title: [187902] trunk/Source/WebInspectorUI
Revision
187902
Author
drou...@apple.com
Date
2015-08-04 15:48:42 -0700 (Tue, 04 Aug 2015)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (187901 => 187902)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-08-04 22:47:43 UTC (rev 187901)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-08-04 22:48:42 UTC (rev 187902)
@@ -1,3 +1,21 @@
+2015-08-04  Devin Rousso  <drou...@apple.com>
+
+        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):
+
 2015-08-04  Matt Baker  <mattba...@apple.com>
 
         Web Inspector: Don't show 'Reveal In Debugger Tab' menu item if already in Debugger tab

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.css (187901 => 187902)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.css	2015-08-04 22:47:43 UTC (rev 187901)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.css	2015-08-04 22:48:42 UTC (rev 187902)
@@ -24,5 +24,6 @@
  */
 
 .CodeMirror .CodeMirror-lines .completion-hint {
+    text-decoration: none !important;
     opacity: 0.4;
 }

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js (187901 => 187902)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js	2015-08-04 22:47:43 UTC (rev 187901)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js	2015-08-04 22:48:42 UTC (rev 187902)
@@ -270,12 +270,9 @@
 
             var from = {line: this._lineNumber, ch: this._startOffset};
             var cursor = {line: this._lineNumber, ch: this._endOffset};
-            var to = {line: this._lineNumber, ch: this._startOffset + replacementText.length};
             var currentText = this._codeMirror.getRange(from, cursor);
 
             this._createCompletionHintMarker(cursor, replacementText.replace(currentText, ""));
-            if (cursor.ch !== to.ch)
-                this._codeMirror.markText(cursor, to, {className: WebInspector.CodeMirrorCompletionController.CompletionHintStyleClassName});
         }
 
         this._ignoreChange = true;
@@ -342,14 +339,22 @@
 
         this._notifyCompletionsHiddenSoon();
 
-        function update()
+        function clearMarker(marker)
         {
-            var range = this._completionHintMarker.find();
+            if (!marker)
+                return;
+
+            var range = marker.find();
             if (range)
-                this._completionHintMarker.clear();
+                marker.clear();
 
-            this._completionHintMarker = null;
+            return null;
+        }
 
+        function update()
+        {
+            this._completionHintMarker = clearMarker(this._completionHintMarker);
+
             if (dontRestorePrefix)
                 return;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to