mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
parent
be9ffc499f
commit
f8ffe1c408
@ -1955,6 +1955,18 @@ describe "EditSession", ->
|
||||
expect(buffer.getLineCount()).toBe(1)
|
||||
expect(buffer.getText()).toBe('')
|
||||
|
||||
describe "when soft wrap is enabled", ->
|
||||
it "deletes the entire line that the cursor is on", ->
|
||||
editSession.setSoftWrapColumn(10)
|
||||
editSession.setCursorBufferPosition([6])
|
||||
|
||||
line7 = buffer.lineForRow(7)
|
||||
count = buffer.getLineCount()
|
||||
expect(buffer.lineForRow(6)).not.toBe(line7)
|
||||
editSession.deleteLine()
|
||||
expect(buffer.lineForRow(6)).toBe(line7)
|
||||
expect(buffer.getLineCount()).toBe(count - 1)
|
||||
|
||||
describe ".transpose()", ->
|
||||
it "swaps two characters", ->
|
||||
editSession.buffer.setText("abc")
|
||||
|
@ -271,7 +271,7 @@ class Selection
|
||||
if @isEmpty()
|
||||
start = @cursor.getScreenRow()
|
||||
range = @editSession.bufferRowsForScreenRows(start, start + 1)
|
||||
if range[1]
|
||||
if range[1] > range[0]
|
||||
@editSession.buffer.deleteRows(range[0], range[1] - 1)
|
||||
else
|
||||
@editSession.buffer.deleteRow(range[0])
|
||||
|
Loading…
Reference in New Issue
Block a user