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

Commit b86570a

Browse files
committed
Different apporach to solve the issue
1 parent 974a92b commit b86570a

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

test/spec/EditorCommandHandlers-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2412,10 +2412,10 @@ define(function (require, exports, module) {
24122412
});
24132413

24142414
describe("Open Line Above and Below", function () {
2415-
var indentUnit = Editor.getUseTabChar() ? 1 : Editor.getSpaceUnits(),
2415+
var indentUnit = SpecRunnerUtils.EDITOR_USE_TABS ? 1 : SpecRunnerUtils.EDITOR_SPACE_UNITS,
24162416
indentation = (function () {
24172417
// generate indent string once
2418-
if (Editor.getUseTabChar()) {
2418+
if (SpecRunnerUtils.EDITOR_USE_TABS) {
24192419
return "\t";
24202420
}
24212421
var spaces = [];

test/spec/SpecRunnerUtils.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ define(function (require, exports, module) {
4040
LanguageManager = require("language/LanguageManager");
4141

4242
var TEST_PREFERENCES_KEY = "com.adobe.brackets.test.preferences",
43+
EDITOR_USE_TABS = false,
44+
EDITOR_SPACE_UNITS = 4,
4345
OPEN_TAG = "{{",
4446
CLOSE_TAG = "}}",
4547
RE_MARKER = /\{\{(\d+)\}\}/g,
@@ -262,6 +264,8 @@ define(function (require, exports, module) {
262264

263265
// create Editor instance
264266
var editor = new Editor(doc, true, $editorHolder.get(0), visibleRange);
267+
Editor.setUseTabChar(EDITOR_USE_TABS);
268+
Editor.setSpaceUnits(EDITOR_SPACE_UNITS);
265269
EditorManager._notifyActiveEditorChanged(editor);
266270

267271
return editor;
@@ -1120,8 +1124,10 @@ define(function (require, exports, module) {
11201124
});
11211125
});
11221126

1123-
exports.TEST_PREFERENCES_KEY = TEST_PREFERENCES_KEY;
1124-
1127+
exports.TEST_PREFERENCES_KEY = TEST_PREFERENCES_KEY;
1128+
exports.EDITOR_USE_TABS = EDITOR_USE_TABS;
1129+
exports.EDITOR_SPACE_UNITS = EDITOR_SPACE_UNITS;
1130+
11251131
exports.chmod = chmod;
11261132
exports.remove = remove;
11271133
exports.getTestRoot = getTestRoot;

0 commit comments

Comments
 (0)