mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Use editor.tabLength config value when creating edit sessions
Closes #708
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -23,6 +23,7 @@ class Editor extends View
|
||||
normalizeIndentOnPaste: true
|
||||
nonWordCharacters: "./\\()\"':,.;<>~!@#$%^&*|+=[]{}`~?-"
|
||||
preferredLineLength: 80
|
||||
tabLength: 2
|
||||
|
||||
@nextEditorId: 1
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user