mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Remove TextEditor::withGroupingInterval
Just use ::transact
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user