Use editor.tabLength config value when creating edit sessions

Closes #708
This commit is contained in:
Kevin Sawicki
2013-08-21 16:48:38 -07:00
parent c18810ca67
commit 2f4db45320
3 changed files with 7 additions and 2 deletions

View File

@@ -66,6 +66,11 @@ describe "Project", ->
Project.unregisterOpener(barOpener)
describe "when passed a path that doesn't match a custom opener", ->
it "creates the edit session with the configured `editor.tabLength` setting", ->
config.set('editor.tabLength', 4)
editSession = project.open('a')
expect(editSession.getTabLength()).toBe 4
describe "when given an absolute path that hasn't been opened previously", ->
it "returns a new edit session for the given path and emits 'buffer-created' and 'edit-session-created' events", ->
editSession = project.open(absolutePath)

View File

@@ -23,6 +23,7 @@ class Editor extends View
normalizeIndentOnPaste: true
nonWordCharacters: "./\\()\"':,.;<>~!@#$%^&*|+=[]{}`~?-"
preferredLineLength: 80
tabLength: 2
@nextEditorId: 1

View File

@@ -39,7 +39,6 @@ class Project
repoName = repoName.replace(/\.git$/, '')
path.join(config.get('core.projectHome'), repoName)
tabLength: 2
softTabs: true
softWrap: false
rootDirectory: null
@@ -372,7 +371,7 @@ class Project
editSession
defaultEditSessionOptions: ->
tabLength: @tabLength
tabLength: config.get('editor.tabLength')
softTabs: @getSoftTabs()
softWrap: @getSoftWrap()