mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Use editor.softWrap config value when creating edit sessions
Closes #666
This commit is contained in:
@@ -66,10 +66,18 @@ 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", ->
|
||||
it "creates the edit session with the configured `editor.tabLength` and `editor.softWrap` settings", ->
|
||||
config.set('editor.tabLength', 4)
|
||||
editSession = project.open('a')
|
||||
expect(editSession.getTabLength()).toBe 4
|
||||
config.set('editor.softWrap', true)
|
||||
editSession1 = project.open('a')
|
||||
expect(editSession1.getTabLength()).toBe 4
|
||||
expect(editSession1.getSoftWrap()).toBe true
|
||||
|
||||
config.set('editor.tabLength', 100)
|
||||
config.set('editor.softWrap', false)
|
||||
editSession2 = project.open('b')
|
||||
expect(editSession2.getTabLength()).toBe 100
|
||||
expect(editSession2.getSoftWrap()).toBe false
|
||||
|
||||
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", ->
|
||||
|
||||
@@ -24,6 +24,7 @@ class Editor extends View
|
||||
nonWordCharacters: "./\\()\"':,.;<>~!@#$%^&*|+=[]{}`~?-"
|
||||
preferredLineLength: 80
|
||||
tabLength: 2
|
||||
softWrap: false
|
||||
|
||||
@nextEditorId: 1
|
||||
|
||||
|
||||
@@ -373,7 +373,7 @@ class Project
|
||||
defaultEditSessionOptions: ->
|
||||
tabLength: config.get('editor.tabLength')
|
||||
softTabs: @getSoftTabs()
|
||||
softWrap: @getSoftWrap()
|
||||
softWrap: config.get('editor.softWrap')
|
||||
|
||||
eachEditSession: (callback) ->
|
||||
callback(editSession) for editSession in @getEditSessions()
|
||||
|
||||
Reference in New Issue
Block a user