From 9e80121f2100bcdb4221defd325088fbc523cfa1 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Wed, 19 Mar 2014 09:43:06 +1100 Subject: [PATCH 1/2] Respects tabSize setting when useTabChar is true --- src/extensions/default/JSLint/main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/extensions/default/JSLint/main.js b/src/extensions/default/JSLint/main.js index 4fbeb8e7361..84e666b1670 100644 --- a/src/extensions/default/JSLint/main.js +++ b/src/extensions/default/JSLint/main.js @@ -60,6 +60,11 @@ define(function (require, exports, module) { // Predefined environments understood by JSLint. var ENVIRONMENTS = ["browser", "node", "couch", "rhino"]; + // gets indentation size depending whether the tabs or spaces are used + function _getIndentSize() { + return PreferencesManager.get("useTabChar") ? PreferencesManager.get("tabSize") : PreferencesManager.get("spaceUnits"); + } + /** * Run JSLint on the current document. Reports results to the main UI. Displays * a gold star when no errors are found. @@ -88,7 +93,7 @@ define(function (require, exports, module) { if (!options.indent) { // default to using the same indentation value that the editor is using - options.indent = PreferencesManager.get("spaceUnits"); + options.indent = _getIndentSize(); } // If the user has not defined the environment, we use browser by default. From 3b60d0ddb04db0e0a862cacb160fe6be1e57b99b Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Thu, 20 Mar 2014 11:58:02 +1100 Subject: [PATCH 2/2] pass fullPath as context to get --- src/extensions/default/JSLint/main.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/extensions/default/JSLint/main.js b/src/extensions/default/JSLint/main.js index 84e666b1670..90c4f24c3cd 100644 --- a/src/extensions/default/JSLint/main.js +++ b/src/extensions/default/JSLint/main.js @@ -61,8 +61,11 @@ define(function (require, exports, module) { var ENVIRONMENTS = ["browser", "node", "couch", "rhino"]; // gets indentation size depending whether the tabs or spaces are used - function _getIndentSize() { - return PreferencesManager.get("useTabChar") ? PreferencesManager.get("tabSize") : PreferencesManager.get("spaceUnits"); + function _getIndentSize(fullPath) { + return PreferencesManager.get( + PreferencesManager.get("useTabChar", fullPath) ? "tabSize" : "spaceUnits", + fullPath + ); } /** @@ -93,7 +96,7 @@ define(function (require, exports, module) { if (!options.indent) { // default to using the same indentation value that the editor is using - options.indent = _getIndentSize(); + options.indent = _getIndentSize(fullPath); } // If the user has not defined the environment, we use browser by default.