Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit c52bffe

Browse files
committed
Merge pull request #7243 from adobe/zaggino/issue-7240
[JSLint] Respects tabSize setting when useTabChar is true
2 parents e08abaf + 3b60d0d commit c52bffe

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • src/extensions/default/JSLint

src/extensions/default/JSLint/main.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ define(function (require, exports, module) {
6060
// Predefined environments understood by JSLint.
6161
var ENVIRONMENTS = ["browser", "node", "couch", "rhino"];
6262

63+
// gets indentation size depending whether the tabs or spaces are used
64+
function _getIndentSize(fullPath) {
65+
return PreferencesManager.get(
66+
PreferencesManager.get("useTabChar", fullPath) ? "tabSize" : "spaceUnits",
67+
fullPath
68+
);
69+
}
70+
6371
/**
6472
* Run JSLint on the current document. Reports results to the main UI. Displays
6573
* a gold star when no errors are found.
@@ -88,7 +96,7 @@ define(function (require, exports, module) {
8896

8997
if (!options.indent) {
9098
// default to using the same indentation value that the editor is using
91-
options.indent = PreferencesManager.get("spaceUnits");
99+
options.indent = _getIndentSize(fullPath);
92100
}
93101

94102
// If the user has not defined the environment, we use browser by default.

0 commit comments

Comments
 (0)