undoDiff undoes last applied change, if any.
(ab int)
| 512 | |
| 513 | // undoDiff undoes last applied change, if any. |
| 514 | func (dv *DiffEditor) undoDiff(ab int) error { |
| 515 | tva, tvb := dv.textEditors() |
| 516 | if ab == 1 { |
| 517 | if !dv.diffs.B.Undo() { |
| 518 | err := errors.New("No more edits to undo") |
| 519 | core.ErrorSnackbar(dv, err) |
| 520 | return err |
| 521 | } |
| 522 | tvb.undo() |
| 523 | } else { |
| 524 | if !dv.diffs.A.Undo() { |
| 525 | err := errors.New("No more edits to undo") |
| 526 | core.ErrorSnackbar(dv, err) |
| 527 | return err |
| 528 | } |
| 529 | tva.undo() |
| 530 | } |
| 531 | return nil |
| 532 | } |
| 533 | |
| 534 | func (dv *DiffEditor) MakeToolbar(p *tree.Plan) { |
| 535 | txta := "A: " + fsx.DirAndFile(dv.FileA) |
no test coverage detected