SoftWrap state is stored in EditSessions, but it is set and toggled via Editor.

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-06-20 09:28:11 -07:00
parent d1c1f3cfce
commit af9aec7cbc
4 changed files with 19 additions and 16 deletions

View File

@@ -24,11 +24,12 @@ class EditSession
selections: null
autoIndent: true
softTabs: true
softWrap: false
constructor: ({@buffer, @tabText, @autoIndent, @softTabs, @softWrapColumn}) ->
constructor: ({@buffer, @tabText, @autoIndent, @softTabs, @softWrap}) ->
@id = @constructor.idCounter++
@softTabs ?= true
@displayBuffer = new DisplayBuffer(@buffer, { @softWrapColumn, @tabText })
@displayBuffer = new DisplayBuffer(@buffer, { @tabText })
@tokenizedBuffer = @displayBuffer.tokenizedBuffer
@cursors = []
@selections = []
@@ -70,6 +71,9 @@ class EditSession
setAutoIndent: (@autoIndent) ->
setSoftTabs: (@softTabs) ->
getSoftWrap: -> @softWrap
setSoftWrap: (@softWrap) ->
clipBufferPosition: (bufferPosition, options) ->
{ row, column } = Point.fromObject(bufferPosition)
row = 0 if row < 0