Clear undo stack after setting initial buffer text

This commit is contained in:
Kevin Sawicki & Nathan Sobo 2013-08-16 11:30:37 -07:00
parent 2f4555a16f
commit a147dc01d7
3 changed files with 8 additions and 1 deletions

View File

@ -28,6 +28,12 @@ describe 'TextBuffer', ->
buffer = project.bufferForPath(filePath)
expect(buffer.getText()).toBe fsUtils.read(filePath)
it "does not allow the initial state of the buffer to be undone", ->
filePath = require.resolve 'fixtures/sample.txt'
buffer = project.bufferForPath(filePath)
buffer.undo()
expect(buffer.getText()).toBe fsUtils.read(filePath)
describe "when no file exists for the path", ->
it "is modified and is initially empty", ->
filePath = "does-not-exist.txt"

View File

@ -59,6 +59,7 @@ class TextBuffer
if fsUtils.exists(@getPath())
@updateCachedDiskContents()
@reload() if reloadFromDisk and @isModified()
@text.clearUndoStack()
### Internal ###

2
vendor/telepath vendored

@ -1 +1 @@
Subproject commit 79ff8d15c8e93ded1f3bf71547587dc5bb095aab
Subproject commit 93ceddf89e6a6b530105cd3df54b15ad0f7251af