mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
🔥
This commit is contained in:
parent
e8387e0095
commit
428f0db75b
@ -143,16 +143,6 @@ describe "DisplayBuffer", ->
|
||||
expect(displayBuffer.tokenizedLineForScreenRow(3).tokens[1].isHardTab).toBeTruthy()
|
||||
|
||||
describe "when a line is wrapped", ->
|
||||
it "marks it as soft-wrapped", ->
|
||||
displayBuffer.setEditorWidthInChars(7)
|
||||
|
||||
expect(displayBuffer.tokenizedLineForScreenRow(0).softWrapped).toBeFalsy()
|
||||
expect(displayBuffer.tokenizedLineForScreenRow(1).softWrapped).toBeTruthy()
|
||||
expect(displayBuffer.tokenizedLineForScreenRow(2).softWrapped).toBeTruthy()
|
||||
expect(displayBuffer.tokenizedLineForScreenRow(3).softWrapped).toBeTruthy()
|
||||
expect(displayBuffer.tokenizedLineForScreenRow(4).softWrapped).toBeTruthy()
|
||||
expect(displayBuffer.tokenizedLineForScreenRow(5).softWrapped).toBeFalsy()
|
||||
|
||||
it "breaks soft-wrap indentation into a token for each indentation level to support indent guides", ->
|
||||
tokenizedLine = displayBuffer.tokenizedLineForScreenRow(4)
|
||||
|
||||
|
@ -677,7 +677,6 @@ class TextEditorPresenter
|
||||
|
||||
screenRow = startRow + i
|
||||
line = @model.tokenizedLineForScreenRow(screenRow)
|
||||
softWrapped = line.softWrapped
|
||||
decorationClasses = @lineNumberDecorationClassesForRow(screenRow)
|
||||
foldable = @model.isFoldableAtScreenRow(screenRow)
|
||||
|
||||
|
@ -34,7 +34,6 @@ class TokenizedLine
|
||||
lineIsWhitespaceOnly: false
|
||||
firstNonWhitespaceIndex: 0
|
||||
foldable: false
|
||||
softWrapped: false
|
||||
|
||||
constructor: (properties) ->
|
||||
@id = idCounter++
|
||||
@ -421,7 +420,6 @@ class TokenizedLine
|
||||
leftFragment.tabLength = @tabLength
|
||||
leftFragment.firstNonWhitespaceIndex = Math.min(column, @firstNonWhitespaceIndex)
|
||||
leftFragment.firstTrailingWhitespaceIndex = Math.min(column, @firstTrailingWhitespaceIndex)
|
||||
leftFragment.softWrapped = @softWrapped
|
||||
|
||||
rightFragment = new TokenizedLine
|
||||
rightFragment.tokenIterator = @tokenIterator
|
||||
@ -439,7 +437,6 @@ class TokenizedLine
|
||||
rightFragment.endOfLineInvisibles = @endOfLineInvisibles
|
||||
rightFragment.firstNonWhitespaceIndex = Math.max(softWrapIndent, @firstNonWhitespaceIndex - column + softWrapIndent)
|
||||
rightFragment.firstTrailingWhitespaceIndex = Math.max(softWrapIndent, @firstTrailingWhitespaceIndex - column + softWrapIndent)
|
||||
rightFragment.softWrapped = true
|
||||
|
||||
[leftFragment, rightFragment]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user