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

Commit

Permalink
Merge pull request #7243 from adobe/zaggino/issue-7240
Browse files Browse the repository at this point in the history
[JSLint] Respects tabSize setting when useTabChar is true
  • Loading branch information
redmunds committed Mar 21, 2014
2 parents e08abaf + 3b60d0d commit c52bffe
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/extensions/default/JSLint/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ 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(fullPath) {
return PreferencesManager.get(
PreferencesManager.get("useTabChar", fullPath) ? "tabSize" : "spaceUnits",
fullPath
);
}

/**
* Run JSLint on the current document. Reports results to the main UI. Displays
* a gold star when no errors are found.
Expand Down Expand Up @@ -88,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 = PreferencesManager.get("spaceUnits");
options.indent = _getIndentSize(fullPath);
}

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

0 comments on commit c52bffe

Please sign in to comment.