mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Remove softWrap decoration option
This commit is contained in:
@@ -540,6 +540,31 @@ describe "EditorComponent", ->
|
||||
expect(lineNumberHasClass(3, 'someclass')).toBe false
|
||||
expect(lineNumberHasClass(4, 'someclass')).toBe false
|
||||
|
||||
describe "when soft wrapping is enabled", ->
|
||||
beforeEach ->
|
||||
editor.setText "a line that wraps, ok"
|
||||
editor.setSoftWrap(true)
|
||||
node.style.width = 16 * charWidth + 'px'
|
||||
component.measureScrollView()
|
||||
|
||||
it "applies decoration only to the first row when marker range does not wrap", ->
|
||||
marker = editor.displayBuffer.markBufferRange([[0, 0], [0, 0]])
|
||||
editor.addDecorationForMarker(marker, type: 'gutter', class: 'someclass')
|
||||
|
||||
waitsFor -> not component.decorationChangedImmediate?
|
||||
runs ->
|
||||
expect(lineNumberHasClass(0, 'someclass')).toBe true
|
||||
expect(lineNumberHasClass(1, 'someclass')).toBe false
|
||||
|
||||
it "applies decoration to both rows when marker wraps", ->
|
||||
marker = editor.displayBuffer.markBufferRange([[0, 0], [0, Infinity]])
|
||||
editor.addDecorationForMarker(marker, type: 'gutter', class: 'someclass')
|
||||
|
||||
waitsFor -> not component.decorationChangedImmediate?
|
||||
runs ->
|
||||
expect(lineNumberHasClass(0, 'someclass')).toBe true
|
||||
expect(lineNumberHasClass(1, 'someclass')).toBe true
|
||||
|
||||
describe "cursor rendering", ->
|
||||
it "renders the currently visible cursors, translated relative to the scroll position", ->
|
||||
cursor1 = editor.getCursor()
|
||||
|
||||
@@ -139,7 +139,7 @@ GutterComponent = React.createClass
|
||||
if decorations?
|
||||
for decoration in decorations
|
||||
if Decoration.isType(decoration, 'gutter')
|
||||
classes += decoration.class + ' ' if not softWrapped or softWrapped and decoration.softWrap
|
||||
classes += decoration.class + ' '
|
||||
|
||||
classes += "foldable " if bufferRow >= 0 and editor.isFoldableAtBufferRow(bufferRow)
|
||||
classes += "line-number line-number-#{bufferRow}"
|
||||
@@ -172,7 +172,7 @@ GutterComponent = React.createClass
|
||||
|
||||
if decorations?
|
||||
for decoration in decorations
|
||||
if Decoration.isType(decoration, 'gutter') and not contains(previousDecorations, decoration) and (not softWrapped or softWrapped and decoration.softWrap)
|
||||
if Decoration.isType(decoration, 'gutter') and not contains(previousDecorations, decoration)
|
||||
node.classList.add(decoration.class)
|
||||
|
||||
unless @screenRowsByLineNumberId[lineNumberId] is screenRow
|
||||
|
||||
Reference in New Issue
Block a user