Bug 1543782: Show the suggestions when user presses ctrl+space. r=pbro
☠☠ backed out by c5ad764d2835 ☠ ☠
authorDaisuke Akatsuka <daisuke@birchill.co.jp>
Fri, 30 Aug 2019 03:14:55 +0000
changeset 551305 822638e9789acfdf47a0c0103a485a9bc4b0fcf1
parent 551304 cb477711fa64b193a78e910895807cb9952ec7a0
child 551306 703a2947c350dc4e9d7426893894c725c7147eed
push id11865
push userbtara@mozilla.com
push dateMon, 02 Sep 2019 08:54:37 +0000
treeherdermozilla-beta@37f59c4671b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1543782
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1543782: Show the suggestions when user presses ctrl+space. r=pbro Differential Revision: https://phabricator.services.mozilla.com/D43720
devtools/client/shared/inplace-editor.js
--- a/devtools/client/shared/inplace-editor.js
+++ b/devtools/client/shared/inplace-editor.js
@@ -1199,21 +1199,26 @@ InplaceEditor.prototype = {
       this._doValidation();
     }
 
     if (isKeyIn(key, "BACK_SPACE", "DELETE", "LEFT", "RIGHT", "HOME", "END")) {
       if (isPopupOpen && this.currentInputValue !== "") {
         this._hideAutocompletePopup();
       }
     } else if (
-      !cycling &&
-      !multilineNavigation &&
-      !event.metaKey &&
-      !event.altKey &&
-      !event.ctrlKey
+      // We may show the suggestion completion if Ctrl+space is pressed, or if an
+      // otherwise unhandled key is pressed and the user is not cycling through the
+      // options in the pop-up menu, it is not an expanded shorthand property, and no
+      // modifier key is pressed.
+      (event.key === " " && event.ctrlKey) ||
+      (!cycling &&
+        !multilineNavigation &&
+        !event.metaKey &&
+        !event.altKey &&
+        !event.ctrlKey)
     ) {
       this._maybeSuggestCompletion(true);
     }
 
     if (this.multiline && event.shiftKey && isKeyIn(key, "RETURN")) {
       prevent = false;
     } else if (
       this._advanceChars(event.charCode, input.value, input.selectionStart) ||