Return optional transaction ids from undo/redo

This will allow the editor to restore selections that it associated with the start or end of a transaction.
This commit is contained in:
Nathan Sobo 2021-12-10 18:08:26 -07:00
parent 77defe6e28
commit f35c419f43
3 changed files with 32 additions and 18 deletions

View file

@ -224,14 +224,14 @@ impl MultiBuffer {
})
}
pub fn undo(&mut self, cx: &mut ModelContext<Self>) {
pub fn undo(&mut self, cx: &mut ModelContext<Self>) -> Option<TransactionId> {
// TODO
self.as_singleton()
.unwrap()
.update(cx, |buffer, cx| buffer.undo(cx))
}
pub fn redo(&mut self, cx: &mut ModelContext<Self>) {
pub fn redo(&mut self, cx: &mut ModelContext<Self>) -> Option<TransactionId> {
// TODO
self.as_singleton()
.unwrap()