Revert softWrapAtNewline attempt

...now we use `skipSoftWrapIndentation: true` when moving up and down.
This commit is contained in:
Antonio Scandurra
2015-02-20 09:46:39 +01:00
parent ed77358515
commit ab5c79d009
4 changed files with 20 additions and 17 deletions

View File

@@ -615,6 +615,18 @@ describe "DisplayBuffer", ->
displayBuffer.createFold(3, 5)
expect(displayBuffer.clipScreenPosition([3, 5], wrapBeyondNewlines: true)).toEqual [4, 0]
describe "when skipSoftWrapIndentation is false (the default)", ->
it "clips positions to the beginning of the line", ->
expect(displayBuffer.clipScreenPosition([4, 0])).toEqual [3, 50]
expect(displayBuffer.clipScreenPosition([4, 1])).toEqual [3, 50]
expect(displayBuffer.clipScreenPosition([4, 3])).toEqual [3, 50]
describe "when skipSoftWrapIndentation is true", ->
it "wraps positions at the end of previous soft-wrapped line", ->
expect(displayBuffer.clipScreenPosition([4, 0], skipSoftWrapIndentation: true)).toEqual [4, 4]
expect(displayBuffer.clipScreenPosition([4, 1], skipSoftWrapIndentation: true)).toEqual [4, 4]
expect(displayBuffer.clipScreenPosition([4, 3], skipSoftWrapIndentation: true)).toEqual [4, 4]
describe "when wrapAtSoftNewlines is false (the default)", ->
it "clips positions at the end of soft-wrapped lines to the character preceding the end of the line", ->
expect(displayBuffer.clipScreenPosition([3, 50])).toEqual [3, 50]
@@ -622,11 +634,6 @@ describe "DisplayBuffer", ->
expect(displayBuffer.clipScreenPosition([3, 58])).toEqual [3, 50]
expect(displayBuffer.clipScreenPosition([3, 1000])).toEqual [3, 50]
it "wraps positions at the end of previous soft-wrapped line", ->
expect(displayBuffer.clipScreenPosition([4, 0])).toEqual [3, 50]
expect(displayBuffer.clipScreenPosition([4, 1])).toEqual [3, 50]
expect(displayBuffer.clipScreenPosition([4, 3])).toEqual [3, 50]
describe "when wrapAtSoftNewlines is true", ->
it "wraps positions at the end of soft-wrapped lines to the next screen line", ->
expect(displayBuffer.clipScreenPosition([3, 50], wrapAtSoftNewlines: true)).toEqual [3, 50]
@@ -634,11 +641,6 @@ describe "DisplayBuffer", ->
expect(displayBuffer.clipScreenPosition([3, 58], wrapAtSoftNewlines: true)).toEqual [4, 4]
expect(displayBuffer.clipScreenPosition([3, 1000], wrapAtSoftNewlines: true)).toEqual [4, 4]
it "clips positions to the beginning of the line", ->
expect(displayBuffer.clipScreenPosition([4, 0], wrapAtSoftNewlines: true)).toEqual [4, 4]
expect(displayBuffer.clipScreenPosition([4, 1], wrapAtSoftNewlines: true)).toEqual [4, 4]
expect(displayBuffer.clipScreenPosition([4, 3], wrapAtSoftNewlines: true)).toEqual [4, 4]
describe "when skipAtomicTokens is false (the default)", ->
it "clips screen positions in the middle of atomic tab characters to the beginning of the character", ->
buffer.insert([0, 0], '\t')

View File

@@ -670,8 +670,8 @@ describe "TokenizedBuffer", ->
[segment1, segment2] = tokenizedLine.softWrapAt(16)
expect(segment1.tokens[5].value).toBe ' '
expect(segment1.tokens[5].firstTrailingWhitespaceIndex).toBe null
expect(segment2.tokens[7].value).toBe ' '
expect(segment2.tokens[7].firstTrailingWhitespaceIndex).toBe 0
expect(segment2.tokens[6].value).toBe ' '
expect(segment2.tokens[6].firstTrailingWhitespaceIndex).toBe 0
it "sets leading and trailing whitespace correctly on a line with invisible characters that is copied", ->
buffer.setText(" \t a line with tabs\tand \tspaces \t ")