[meld] Fix undo for grouped actions
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Fix undo for grouped actions
- Date: Sun, 27 Jun 2010 00:09:43 +0000 (UTC)
commit a8a9940ff2b0c892146250244287cb3158ec3d65
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Jun 27 09:57:34 2010 +1000
Fix undo for grouped actions
The recent checkpoint-related undo rework requires every action to have
an associated buffer. While this is true of all of our basic actions, it
breaks for grouped actions. This commit adds a slightly hacky workaround
by assuming that a group of actions all operates on the same buffer.
While this is currently accurate, future changes could break it.
meld/undo.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/meld/undo.py b/meld/undo.py
index 17569ed..31e948d 100644
--- a/meld/undo.py
+++ b/meld/undo.py
@@ -38,6 +38,9 @@ class GroupAction(object):
"""
def __init__(self, seq):
self.seq = seq
+ # TODO: If a GroupAction affects more than one sequence, our logic
+ # breaks. Currently, this isn't a problem.
+ self.buffer = seq.actions[0].buffer
def undo(self):
while self.seq.can_undo():
self.seq.undo()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]