diff --git a/lib/minimap-element.coffee b/lib/minimap-element.coffee index f96ce79b..d67e97ac 100644 --- a/lib/minimap-element.coffee +++ b/lib/minimap-element.coffee @@ -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 diff --git a/spec/minimap-element-spec.coffee b/spec/minimap-element-spec.coffee index c53c2ab3..d0046da9 100644 --- a/spec/minimap-element-spec.coffee +++ b/spec/minimap-element-spec.coffee @@ -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)