Remove foldable from ScreenLine

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-11-06 11:41:48 -08:00
parent 139f5d0b50
commit b8beec6f55
3 changed files with 2 additions and 20 deletions

View File

@@ -145,21 +145,6 @@ describe "DisplayBuffer", ->
expect(event.lineNumbersChanged).toBeTruthy()
describe "structural folding", ->
describe "the foldable flag on screen lines", ->
it "sets 'foldable' to true for screen lines that start a foldable region", ->
expect(displayBuffer.lineForRow(0).foldable).toBeTruthy()
expect(displayBuffer.lineForRow(1).foldable).toBeTruthy()
expect(displayBuffer.lineForRow(2).foldable).toBeFalsy()
expect(displayBuffer.lineForRow(3).foldable).toBeFalsy()
describe "when a foldable line is wrapped", ->
it "only marks the first screen line as foldable", ->
displayBuffer.setSoftWrapColumn(20)
expect(displayBuffer.lineForRow(0).foldable).toBeTruthy()
expect(displayBuffer.lineForRow(1).foldable).toBeFalsy()
expect(displayBuffer.lineForRow(2).foldable).toBeTruthy()
expect(displayBuffer.lineForRow(3).foldable).toBeFalsy()
describe ".unfoldAll()", ->
it "unfolds every folded line", ->
displayBuffer.foldBufferRow(0)

View File

@@ -222,7 +222,6 @@ class DisplayBuffer
startBufferColumn = 0
while currentBufferRow <= endBufferRow
screenLine = @tokenizedBuffer.lineForScreenRow(currentBufferRow)
screenLine.foldable = @languageMode.doesBufferRowStartFold(currentBufferRow)
if fold = @largestFoldStartingAtBufferRow(currentBufferRow)
screenLine = screenLine.copy()

View File

@@ -2,14 +2,13 @@ _ = require 'underscore'
module.exports =
class ScreenLine
constructor: ({@tokens, @ruleStack, @bufferRows, @startBufferColumn, @fold, @foldable}) ->
constructor: ({@tokens, @ruleStack, @bufferRows, @startBufferColumn, @fold}) ->
@bufferRows ?= 1
@startBufferColumn ?= 0
@foldable ?= false
@text = _.pluck(@tokens, 'value').join('')
copy: ->
new ScreenLine({@tokens, @ruleStack, @bufferRows, @startBufferColumn, @fold, @foldable})
new ScreenLine({@tokens, @ruleStack, @bufferRows, @startBufferColumn, @fold})
clipScreenColumn: (column, options={}) ->
{ skipAtomicTokens } = options
@@ -74,7 +73,6 @@ class ScreenLine
bufferRows: 0
startBufferColumn: @startBufferColumn
ruleStack: @ruleStack
foldable: @foldable
)
rightFragment = new ScreenLine(
tokens: rightTokens