mirror of
https://github.com/atom/atom.git
synced 2026-01-25 14:59:03 -05:00
Folds can start at the beginning of a line
This commit is contained in:
@@ -173,6 +173,11 @@ describe "LineFolder", ->
|
||||
expect(event.oldRange).toEqual [[7, 0], [7, 28]]
|
||||
expect(event.newRange).toEqual [[7, 0], [8, 56]]
|
||||
|
||||
describe "when the fold is at the beginning of the line", ->
|
||||
it "renders a placeholder at the beginning of the line", ->
|
||||
folder.createFold(new Range([4, 0], [7, 4]))
|
||||
expect(folder.lineForScreenRow(4).text).toBe '...}'
|
||||
|
||||
describe "when the buffer changes", ->
|
||||
[fold1, fold2] = []
|
||||
beforeEach ->
|
||||
|
||||
@@ -95,10 +95,10 @@ class LineFolder
|
||||
screenLine = @highlighter.lineForScreenRow(bufferRow).splitAt(startColumn)[1]
|
||||
for fold in @foldsForBufferRow(bufferRow)
|
||||
{ start, end } = fold.getRange()
|
||||
if start.column > startColumn
|
||||
if start.column >= startColumn
|
||||
prefix = screenLine.splitAt(start.column - startColumn)[0]
|
||||
suffix = @buildLineForBufferRow(end.row, end.column)
|
||||
return _.flatten([prefix, @buildFoldPlaceholder(fold), suffix])
|
||||
return _.compact(_.flatten([prefix, @buildFoldPlaceholder(fold), suffix]))
|
||||
screenLine
|
||||
|
||||
buildFoldPlaceholder: (fold) ->
|
||||
|
||||
Reference in New Issue
Block a user