mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Clear undo stack after setting initial buffer text
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -59,6 +59,7 @@ class TextBuffer
|
||||
if fsUtils.exists(@getPath())
|
||||
@updateCachedDiskContents()
|
||||
@reload() if reloadFromDisk and @isModified()
|
||||
@text.clearUndoStack()
|
||||
|
||||
### Internal ###
|
||||
|
||||
|
||||
2
vendor/telepath
vendored
2
vendor/telepath
vendored
Submodule vendor/telepath updated: 79ff8d15c8...93ceddf89e
Reference in New Issue
Block a user