mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-24 17:50:15 +09:00
Allow changes from external programs to be undone
We use a diff to be able to transform the buffer into an arbitrary string (usually when we reread the file after an external program such as gofmt has changed it) and still preserve undo/redo. Fixes #136
This commit is contained in:
@@ -155,11 +155,7 @@ func (b *Buffer) ReOpen() {
|
||||
messenger.Error(err.Error())
|
||||
return
|
||||
}
|
||||
if txt == "" {
|
||||
b.r = new(rope.Rope)
|
||||
} else {
|
||||
b.r = rope.New(txt)
|
||||
}
|
||||
b.EventHandler.ApplyDiff(txt)
|
||||
|
||||
b.ModTime, _ = GetModTime(b.Path)
|
||||
b.IsModified = false
|
||||
|
||||
Reference in New Issue
Block a user