mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
@@ -2773,6 +2773,11 @@ describe "Editor", ->
|
||||
expect(cursor1.getBufferPosition()).toEqual [0,0]
|
||||
expect(cursor3.getBufferPosition()).toEqual [1,2]
|
||||
|
||||
describe 'reading text', ->
|
||||
it '.lineTextForScreenRow(row)', ->
|
||||
editor.foldBufferRow(4)
|
||||
expect(editor.lineTextForScreenRow(5)).toEqual ' return sort(left).concat(pivot).concat(sort(right));'
|
||||
|
||||
describe ".deleteLine()", ->
|
||||
it "deletes the first line when the cursor is there", ->
|
||||
editor.getLastCursor().moveToTop()
|
||||
|
||||
@@ -418,6 +418,12 @@ class Editor extends Model
|
||||
deprecate 'Use Editor::lineTextForBufferRow(bufferRow) instead'
|
||||
@lineTextForBufferRow(bufferRow)
|
||||
|
||||
# Public: Returns a {String} representing the contents of the line at the
|
||||
# given screen row.
|
||||
#
|
||||
# * `screenRow` A {Number} representing a zero-indexed screen row.
|
||||
lineTextForScreenRow: (screenRow) -> @displayBuffer.tokenizedLineForScreenRow(screenRow).text
|
||||
|
||||
# Gets the screen line for the given screen row.
|
||||
#
|
||||
# * `screenRow` - A {Number} indicating the screen row.
|
||||
|
||||
Reference in New Issue
Block a user