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()
|
expect(displayBuffer.tokenizedLineForScreenRow(3).tokens[1].isHardTab).toBeTruthy()
|
||||||
|
|
||||||
describe "when a line is wrapped", ->
|
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", ->
|
it "breaks soft-wrap indentation into a token for each indentation level to support indent guides", ->
|
||||||
tokenizedLine = displayBuffer.tokenizedLineForScreenRow(4)
|
tokenizedLine = displayBuffer.tokenizedLineForScreenRow(4)
|
||||||
|
|
||||||
|
@ -677,7 +677,6 @@ class TextEditorPresenter
|
|||||||
|
|
||||||
screenRow = startRow + i
|
screenRow = startRow + i
|
||||||
line = @model.tokenizedLineForScreenRow(screenRow)
|
line = @model.tokenizedLineForScreenRow(screenRow)
|
||||||
softWrapped = line.softWrapped
|
|
||||||
decorationClasses = @lineNumberDecorationClassesForRow(screenRow)
|
decorationClasses = @lineNumberDecorationClassesForRow(screenRow)
|
||||||
foldable = @model.isFoldableAtScreenRow(screenRow)
|
foldable = @model.isFoldableAtScreenRow(screenRow)
|
||||||
|
|
||||||
|
@ -34,7 +34,6 @@ class TokenizedLine
|
|||||||
lineIsWhitespaceOnly: false
|
lineIsWhitespaceOnly: false
|
||||||
firstNonWhitespaceIndex: 0
|
firstNonWhitespaceIndex: 0
|
||||||
foldable: false
|
foldable: false
|
||||||
softWrapped: false
|
|
||||||
|
|
||||||
constructor: (properties) ->
|
constructor: (properties) ->
|
||||||
@id = idCounter++
|
@id = idCounter++
|
||||||
@ -421,7 +420,6 @@ class TokenizedLine
|
|||||||
leftFragment.tabLength = @tabLength
|
leftFragment.tabLength = @tabLength
|
||||||
leftFragment.firstNonWhitespaceIndex = Math.min(column, @firstNonWhitespaceIndex)
|
leftFragment.firstNonWhitespaceIndex = Math.min(column, @firstNonWhitespaceIndex)
|
||||||
leftFragment.firstTrailingWhitespaceIndex = Math.min(column, @firstTrailingWhitespaceIndex)
|
leftFragment.firstTrailingWhitespaceIndex = Math.min(column, @firstTrailingWhitespaceIndex)
|
||||||
leftFragment.softWrapped = @softWrapped
|
|
||||||
|
|
||||||
rightFragment = new TokenizedLine
|
rightFragment = new TokenizedLine
|
||||||
rightFragment.tokenIterator = @tokenIterator
|
rightFragment.tokenIterator = @tokenIterator
|
||||||
@ -439,7 +437,6 @@ class TokenizedLine
|
|||||||
rightFragment.endOfLineInvisibles = @endOfLineInvisibles
|
rightFragment.endOfLineInvisibles = @endOfLineInvisibles
|
||||||
rightFragment.firstNonWhitespaceIndex = Math.max(softWrapIndent, @firstNonWhitespaceIndex - column + softWrapIndent)
|
rightFragment.firstNonWhitespaceIndex = Math.max(softWrapIndent, @firstNonWhitespaceIndex - column + softWrapIndent)
|
||||||
rightFragment.firstTrailingWhitespaceIndex = Math.max(softWrapIndent, @firstTrailingWhitespaceIndex - column + softWrapIndent)
|
rightFragment.firstTrailingWhitespaceIndex = Math.max(softWrapIndent, @firstTrailingWhitespaceIndex - column + softWrapIndent)
|
||||||
rightFragment.softWrapped = true
|
|
||||||
|
|
||||||
[leftFragment, rightFragment]
|
[leftFragment, rightFragment]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user