Title: [220614] trunk/Source/WebInspectorUI
Revision
220614
Author
nvasil...@apple.com
Date
2017-08-11 15:33:28 -0700 (Fri, 11 Aug 2017)

Log Message

Web Inspector: Clicking on suggestion hint should apply it, not dismiss
https://bugs.webkit.org/show_bug.cgi?id=175409

Reviewed by Matt Baker.

Make clicking on the suggestion hint apply the completion, and place the text caret after it.

* UserInterface/Controllers/CodeMirrorCompletionController.js:
(WI.CodeMirrorCompletionController.prototype._createCompletionHintMarker):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (220613 => 220614)


--- trunk/Source/WebInspectorUI/ChangeLog	2017-08-11 22:21:48 UTC (rev 220613)
+++ trunk/Source/WebInspectorUI/ChangeLog	2017-08-11 22:33:28 UTC (rev 220614)
@@ -1,5 +1,17 @@
 2017-08-11  Nikita Vasilyev  <nvasil...@apple.com>
 
+        Web Inspector: Clicking on suggestion hint should apply it, not dismiss
+        https://bugs.webkit.org/show_bug.cgi?id=175409
+
+        Reviewed by Matt Baker.
+
+        Make clicking on the suggestion hint apply the completion, and place the text caret after it.
+
+        * UserInterface/Controllers/CodeMirrorCompletionController.js:
+        (WI.CodeMirrorCompletionController.prototype._createCompletionHintMarker):
+
+2017-08-11  Nikita Vasilyev  <nvasil...@apple.com>
+
         Web Inspector: Styles: Update the filter icon to match Xcode
         https://bugs.webkit.org/show_bug.cgi?id=175458
         <rdar://problem/33838660>

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js (220613 => 220614)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js	2017-08-11 22:21:48 UTC (rev 220613)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js	2017-08-11 22:33:28 UTC (rev 220614)
@@ -251,6 +251,14 @@
         container.classList.add(WI.CodeMirrorCompletionController.CompletionHintStyleClassName);
         container.textContent = text;
 
+        container.addEventListener("mousedown", (event) => {
+            event.preventDefault();
+            this._commitCompletionHint();
+
+            // The clicked hint marker causes the editor to loose focus. Restore it so the user can keep typing.
+            setTimeout(() => { this._codeMirror.focus() }, 0);
+        });
+
         this._completionHintMarker = this._codeMirror.setUniqueBookmark(position, {widget: container, insertLeft: true});
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to