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:
parent
77defe6e28
commit
f35c419f43
3 changed files with 32 additions and 18 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue