提交 d47f1f00 编写于 作者: A Alex Dima

Fixes #1125: change defaults to insertSpaces: true, tabSize: 4

上级 960258c8
...@@ -63,8 +63,8 @@ class ConfigClass implements IConfiguration { ...@@ -63,8 +63,8 @@ class ConfigClass implements IConfiguration {
referenceInfos: true, referenceInfos: true,
renderWhitespace: false, renderWhitespace: false,
tabSize: 'auto', tabSize: 4,
insertSpaces: 'auto', insertSpaces: true,
fontFamily: '', fontFamily: '',
fontSize: 0, fontSize: 0,
lineHeight: 0 lineHeight: 0
......
...@@ -490,12 +490,14 @@ export interface ICommonEditorOptions { ...@@ -490,12 +490,14 @@ export interface ICommonEditorOptions {
export interface IEditorOptions extends ICommonEditorOptions { export interface IEditorOptions extends ICommonEditorOptions {
/** /**
* Tab size in spaces. This is used for rendering and for editing. * Tab size in spaces. This is used for rendering and for editing.
* Defaults to 'auto', meaning the model attached to the editor will be scanned and this property will be guessed. * 'auto' means the model attached to the editor will be scanned and this property will be guessed.
* Defaults to 4.
*/ */
tabSize?:any; tabSize?:any;
/** /**
* Insert spaces instead of tabs when indenting or when auto-indenting. * Insert spaces instead of tabs when indenting or when auto-indenting.
* Defaults to 'auto', meaning the model attached to the editor will be scanned and this property will be guessed. * 'auto' means the model attached to the editor will be scanned and this property will be guessed.
* Defaults to true.
*/ */
insertSpaces?:any; insertSpaces?:any;
/** /**
......
...@@ -756,7 +756,10 @@ suite('Editor Controller - Cursor', () => { ...@@ -756,7 +756,10 @@ suite('Editor Controller - Cursor', () => {
test('Bug 9121: Auto indent + undo + redo is funky', () => { test('Bug 9121: Auto indent + undo + redo is funky', () => {
var model = new Model.Model('', thisHighlighter); var model = new Model.Model('', thisHighlighter);
var cursor = new Cursor.Cursor(1, new MockConfiguration(null), model, null, false); var cursor = new Cursor.Cursor(1, new MockConfiguration({
tabSize: 4,
insertSpaces: false
}), model, null, false);
cursorCommand(cursor, H.Type, { text: '\n' }, null, 'keyboard'); cursorCommand(cursor, H.Type, { text: '\n' }, null, 'keyboard');
assert.equal(model.getValue(EditorCommon.EndOfLinePreference.LF), '\n', 'assert1'); assert.equal(model.getValue(EditorCommon.EndOfLinePreference.LF), '\n', 'assert1');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册