Skip to content

Commit

Permalink
Add softWrapAtPreferredLineLength test case
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Feb 9, 2015
1 parent 9d3112e commit 9ca75ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/minimap-element.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ class MinimapElement extends HTMLElement
softWrapAtPreferredLineLength = atom.config.get('editor.softWrapAtPreferredLineLength')
width = lineLength * @minimap.getCharWidth()

if softWrap && softWrapAtPreferredLineLength and lineLength and width < @width
if softWrap and softWrapAtPreferredLineLength and lineLength and width < @width
@marginRight = width - @width
canvasWidth = width
else
Expand Down
9 changes: 9 additions & 0 deletions spec/minimap-element-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,15 @@ describe 'MinimapElement', ->
expect(minimapElement.offsetWidth).toBeCloseTo(editorElement.offsetWidth / 11, -1)
expect(minimapElement.style.width).toEqual('')

describe 'and when preferredLineLength >= 16384', ->
beforeEach ->
atom.config.set 'minimap.preferredLineLength', 16384
nextAnimationFrame()

it 'adjusts the width of the minimap', ->
expect(minimapElement.offsetWidth).toBeCloseTo(editorElement.offsetWidth / 11, -1)
expect(minimapElement.style.width).toEqual('')

describe 'when minimap.minimapScrollIndicator setting is true', ->
beforeEach ->
editor.setText(mediumSample)
Expand Down

0 comments on commit 9ca75ac

Please sign in to comment.