Remove TextEditor::withGroupingInterval

Just use ::transact
This commit is contained in:
Max Brunsfeld
2014-11-05 14:35:09 -08:00
parent 5437236304
commit e7eef89fa5
4 changed files with 13 additions and 48 deletions

View File

@@ -2816,36 +2816,6 @@ describe "TextEditor", ->
editor.redo()
expect(editor.getSelectedBufferRanges()).toEqual [[[1, 6], [1, 6]], [[1, 18], [1, 18]]]
describe ".withGroupingInterval(interval)", ->
currentTime = null
beforeEach ->
currentTime = 0
spyOn(Date, 'now').andCallFake -> currentTime
it "allows undo entries to be grouped", ->
buffer.setText("")
editor.withGroupingInterval 200, ->
editor.insertText("1")
currentTime += 199
editor.insertText("2")
currentTime += 199
editor.insertText("3")
currentTime += 200
editor.insertText("4")
expect(buffer.getText()).toBe "1234"
editor.undo()
expect(buffer.getText()).toBe "123"
editor.undo()
expect(buffer.getText()).toBe ""
xit "restores folds after undo and redo", ->
editor.foldBufferRow(1)
editor.setSelectedBufferRange([[1, 0], [10, Infinity]], preserveFolds: true)