Bug 906632 - Indentation size in gcli's JavaScript beautifier should follow devtools.editor.tabsize. r=mratcliffe
--- 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" }