diff options
| author | Mattias Andrée <maandree@operamail.com> | 2013-09-10 14:26:44 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@operamail.com> | 2013-09-10 14:26:44 +0200 |
| commit | 95ca504fd3509839c601f07d56ecfaf404911b85 (patch) | |
| tree | 57f4373526efcb2a9d45d0aa0904b6dd78faafd4 /src | |
| parent | introduce a new class for undo and redo (diff) | |
| download | pytagomacs-95ca504fd3509839c601f07d56ecfaf404911b85.tar.gz pytagomacs-95ca504fd3509839c601f07d56ecfaf404911b85.tar.bz2 pytagomacs-95ca504fd3509839c601f07d56ecfaf404911b85.tar.xz | |
add class edit for storing edits in
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/editring.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/editring.py b/src/editring.py index c466234..4c304be 100644 --- a/src/editring.py +++ b/src/editring.py @@ -20,6 +20,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ''' + +class Edit(): + ''' + A line edit + ''' + + def __init__(self, deleted, inserted, y, old_x, new_x): + ''' + Constructor + + @param deleted:str? The text deleted by the edit + @param inserted:str? The text inserted by the edit + @param y:int The index of the line the edit was made one + @param old_x:int The position on the line before the edit was made + @param new_x:int The position on the line after the edit was made + ''' + self.deleted, self.inserted = deleted, inserted + self.y, self.old_x, self.new_x = y, old_x, new_x + + + class Editring(): ''' Editing ring class |
