Bug 906632 - Indentation size in gcli's JavaScript beautifier should follow devtools.editor.tabsize. r=mratcliffe
authorSebastian Hengst <archaeopteryx@coole-files.de>
Mon, 09 Jun 2014 09:03:35 +0200
changeset 187767 929a6d94fa242c45decef7ac64db3febb6e1f2be
parent 187622 101f7b3319628e709a8e54fca773f9a7ac91710f
child 187768 565d5db8f4d1a7cdf6da9a1fa75056883f86e26a
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmratcliffe
bugs906632
milestone32.0a1
Bug 906632 - Indentation size in gcli's JavaScript beautifier should follow devtools.editor.tabsize. r=mratcliffe
toolkit/devtools/gcli/commands/jsb.js
--- a/toolkit/devtools/gcli/commands/jsb.js
+++ b/toolkit/devtools/gcli/commands/jsb.js
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { Cc, Ci, Cu } = require("chrome");
 const gcli = require("gcli/index");
 const XMLHttpRequest = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"];
 
+loader.lazyImporter(this, "Preferences", "resource://gre/modules/Preferences.jsm");
 loader.lazyImporter(this, "js_beautify", "resource:///modules/devtools/Jsbeautify.jsm");
 
 exports.items = [
   {
     name: "jsb",
     description: gcli.lookup("jsbDesc"),
     returnValue:"string",
     params: [
@@ -24,17 +25,17 @@ exports.items = [
       {
         group: gcli.lookup("jsbOptionsDesc"),
         params: [
           {
             name: "indentSize",
             type: "number",
             description: gcli.lookup("jsbIndentSizeDesc"),
             manual: gcli.lookup("jsbIndentSizeManual"),
-            defaultValue: 2
+            defaultValue: Preferences.get("devtools.editor.tabsize", 2),
           },
           {
             name: "indentChar",
             type: {
               name: "selection",
               lookup: [
                 { name: "space", value: " " },
                 { name: "tab", value: "\t" }