mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
Gracefully handle the case when there is no screenline
This commit is contained in:
parent
523a255e48
commit
b90670ff2d
@ -2777,6 +2777,7 @@ describe "Editor", ->
|
||||
it '.lineTextForScreenRow(row)', ->
|
||||
editor.foldBufferRow(4)
|
||||
expect(editor.lineTextForScreenRow(5)).toEqual ' return sort(left).concat(pivot).concat(sort(right));'
|
||||
expect(editor.lineTextForScreenRow(100)).not.toBeDefined()
|
||||
|
||||
describe ".deleteLine()", ->
|
||||
it "deletes the first line when the cursor is there", ->
|
||||
|
@ -422,7 +422,7 @@ class Editor extends Model
|
||||
# given screen row.
|
||||
#
|
||||
# * `screenRow` A {Number} representing a zero-indexed screen row.
|
||||
lineTextForScreenRow: (screenRow) -> @displayBuffer.tokenizedLineForScreenRow(screenRow).text
|
||||
lineTextForScreenRow: (screenRow) -> @displayBuffer.tokenizedLineForScreenRow(screenRow)?.text
|
||||
|
||||
# Gets the screen line for the given screen row.
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user