Bug 1024913 - Add a preference to enable the reverse search UI; r=bgrins.
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Mon, 10 Sep 2018 10:21:46 +0000
changeset 435379 c73046f4daa3be393a550c30de7d6f7f6b4c05fb
parent 435378 51010e069de1edcd4d4d1b40a8d34ac8190a13ed
child 435380 ab579e9e03e7b927b8d4645da6f27bfacc2bd2eb
push id69006
push usernchevobbe@mozilla.com
push dateMon, 10 Sep 2018 11:48:01 +0000
treeherderautoland@c73046f4daa3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1024913
milestone64.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 1024913 - Add a preference to enable the reverse search UI; r=bgrins. Retrieve this preference in the console to pass it as a prop to the root App component. Differential Revision: https://phabricator.services.mozilla.com/D5149
devtools/client/preferences/devtools-client.js
devtools/client/webconsole/store.js
devtools/client/webconsole/webconsole-output-wrapper.js
--- a/devtools/client/preferences/devtools-client.js
+++ b/devtools/client/preferences/devtools-client.js
@@ -285,16 +285,23 @@ pref("devtools.webconsole.sidebarToggle"
 
 // Enable CodeMirror in the JsTerm in Nightly builds
 #if defined(NIGHTLY_BUILD)
 pref("devtools.webconsole.jsterm.codeMirror", true);
 #else
 pref("devtools.webconsole.jsterm.codeMirror", false);
 #endif
 
+// Enable console input reverse-search in Nightly builds
+#if defined(NIGHTLY_BUILD)
+pref("devtools.webconsole.jsterm.reverse-search", true);
+#else
+pref("devtools.webconsole.jsterm.reverse-search", false);
+#endif
+
 // Disable the new performance recording panel by default
 pref("devtools.performance.new-panel-enabled", false);
 
 // Enable client-side mapping service for source maps
 pref("devtools.source-map.client-service.enabled", true);
 
 // The number of lines that are displayed in the web console.
 pref("devtools.hud.loglimit", 10000);
--- a/devtools/client/webconsole/store.js
+++ b/devtools/client/webconsole/store.js
@@ -44,23 +44,25 @@ function configureStore(hud, options = {
     getBoolPref,
     getIntPref,
   } = prefsService;
 
   const logLimit = options.logLimit
     || Math.max(getIntPref("devtools.hud.loglimit"), 1);
   const sidebarToggle = getBoolPref(PREFS.FEATURES.SIDEBAR_TOGGLE);
   const jstermCodeMirror = getBoolPref(PREFS.FEATURES.JSTERM_CODE_MIRROR);
+  const jstermReverseSearch = getBoolPref(PREFS.FEATURES.JSTERM_REVERSE_SEARCH);
   const historyCount = getIntPref(PREFS.UI.INPUT_HISTORY_COUNT);
 
   const initialState = {
     prefs: PrefState({
       logLimit,
       sidebarToggle,
       jstermCodeMirror,
+      jstermReverseSearch,
       historyCount,
     }),
     filters: FilterState({
       error: getBoolPref(PREFS.FILTER.ERROR),
       warn: getBoolPref(PREFS.FILTER.WARN),
       info: getBoolPref(PREFS.FILTER.INFO),
       debug: getBoolPref(PREFS.FILTER.DEBUG),
       log: getBoolPref(PREFS.FILTER.LOG),
--- a/devtools/client/webconsole/webconsole-output-wrapper.js
+++ b/devtools/client/webconsole/webconsole-output-wrapper.js
@@ -83,17 +83,16 @@ WebConsoleOutputWrapper.prototype = {
         }
 
         if (this.hud && this.hud.jsterm) {
           this.hud.jsterm.focus();
         }
       });
 
       const { hud } = this;
-
       const serviceContainer = {
         attachRefToHud,
         emitNewMessage: (node, messageId, timeStamp) => {
           hud.emit("new-messages", new Set([{
             node,
             messageId,
             timeStamp,
           }]));
@@ -241,24 +240,26 @@ WebConsoleOutputWrapper.prototype = {
             const onNodeFrontSet = this.toolbox.selection
               .setNodeFront(front, { reason: "console" });
 
             return Promise.all([onNodeFrontSet, onInspectorUpdated]);
           }
         });
       }
 
+      const {prefs} = store.getState();
       const app = App({
         attachRefToHud,
         serviceContainer,
         hud,
         onFirstMeaningfulPaint: resolve,
         closeSplitConsole: this.closeSplitConsole.bind(this),
-        jstermCodeMirror: store.getState().prefs.jstermCodeMirror
+        jstermCodeMirror: prefs.jstermCodeMirror
           && !Services.appinfo.accessibilityEnabled,
+        jstermReverseSearch: prefs.jstermReverseSearch,
       });
 
       // Render the root Application component.
       const provider = createElement(Provider, { store }, app);
       this.body = ReactDOM.render(provider, this.parentNode);
     });
   },