Merge pull request #5786 from atom/iz-no-foldable-icon-on-soft-wrapped-lines

Don't show foldable icon on soft wrapped lines
This commit is contained in:
Nathan Sobo 2015-02-27 09:16:56 -07:00
commit e57d1f17a1
2 changed files with 14 additions and 2 deletions

View File

@ -637,6 +637,18 @@ describe "TextEditorComponent", ->
nextAnimationFrame()
expect(lineNumberHasClass(5, 'folded')).toBe false
describe "when soft wrapping is enabled", ->
beforeEach ->
editor.setSoftWrapped(true)
nextAnimationFrame()
componentNode.style.width = 16 * charWidth + editor.getVerticalScrollbarWidth() + 'px'
component.measureHeightAndWidth()
nextAnimationFrame()
it "doesn't add the foldable class for soft-wrapped lines", ->
expect(lineNumberHasClass(0, 'foldable')).toBe true
expect(lineNumberHasClass(1, 'foldable')).toBe false
describe "mouse interactions with fold indicators", ->
[gutterNode] = []

View File

@ -124,10 +124,10 @@ class GutterComponent
oldLineNumberState.top = newLineNumberState.top
oldLineNumberState.screenRow = newLineNumberState.screenRow
buildLineNumberClassName: ({bufferRow, foldable, decorationClasses}) ->
buildLineNumberClassName: ({bufferRow, foldable, decorationClasses, softWrapped}) ->
className = "line-number line-number-#{bufferRow}"
className += " " + decorationClasses.join(' ') if decorationClasses?
className += " foldable" if foldable
className += " foldable" if foldable and not softWrapped
className
lineNumberNodeForScreenRow: (screenRow) ->