Bug 1024913 - Add a preference to enable the reverse search UI; r=bgrins.
☠☠ backed out by bda5c062ad28 ☠ ☠
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Mon, 10 Sep 2018 05:14:14 +0000
changeset 435359 1613377c1b43eb5b698aac444043756e05dc62ef
parent 435358 4d24f782140b13bfeb41cf2051e6da4c1da1fc08
child 435360 ccd6afc2a739f8fbb25c5439de12e885287ac1c2
push id68990
push usernchevobbe@mozilla.com
push dateMon, 10 Sep 2018 05:19:41 +0000
treeherderautoland@1613377c1b43 [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);
     });
   },