mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Merge branch 'fold-simplification' of github.com:github/atom into fold-simplification
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
RootView = require 'root-view'
|
||||
RootView = require 'root-view'
|
||||
Buffer = require 'buffer'
|
||||
Editor = require 'editor'
|
||||
Range = require 'range'
|
||||
|
||||
@@ -291,7 +291,7 @@ describe "Renderer", ->
|
||||
changeHandler.reset()
|
||||
|
||||
describe "when a fold is nested within another fold", ->
|
||||
fit "does not render the placeholder for the inner fold until the outer fold is destroyed", ->
|
||||
it "does not render the placeholder for the inner fold until the outer fold is destroyed", ->
|
||||
innerFold = renderer.createFold(6, 7)
|
||||
outerFold = renderer.createFold(4, 8)
|
||||
|
||||
@@ -316,7 +316,7 @@ describe "Renderer", ->
|
||||
expect(line6.screenDelta).toEqual [1, 0]
|
||||
expect(line7.text).toBe '8'
|
||||
|
||||
fit "allows the outer fold to start at the same location as the inner fold", ->
|
||||
it "allows the outer fold to start at the same location as the inner fold", ->
|
||||
innerFold = renderer.createFold(4, 6)
|
||||
outerFold = renderer.createFold(4, 8)
|
||||
|
||||
|
||||
@@ -461,18 +461,17 @@ class Editor extends View
|
||||
charWidth = @charWidth
|
||||
charHeight = @charHeight
|
||||
lines = @renderer.linesForRows(startRow, endRow)
|
||||
|
||||
$$ ->
|
||||
for line in lines
|
||||
@div class: 'line', =>
|
||||
appendNbsp = true
|
||||
for token in line.tokens
|
||||
if token.type is 'fold-placeholder'
|
||||
@span ' ', class: 'fold-placeholder', style: "width: #{3 * charWidth}px; height: #{charHeight}px;", 'foldId': token.fold.id, =>
|
||||
@div class: "ellipsis", => @raw "…"
|
||||
else
|
||||
appendNbsp = false
|
||||
lineClass = 'line'
|
||||
lineClass += ' fold' if line.fold?
|
||||
@div class: lineClass, =>
|
||||
if line.text == ''
|
||||
@raw ' ' if line.text == ''
|
||||
else
|
||||
for token in line.tokens
|
||||
@span { class: token.type.replace('.', ' ') }, token.value
|
||||
@raw ' ' if appendNbsp
|
||||
|
||||
insertLineElements: (row, lineElements) ->
|
||||
@spliceLineElements(row, 0, lineElements)
|
||||
|
||||
Reference in New Issue
Block a user