diff options
| author | Mattias Andrée <maandree@operamail.com> | 2013-09-20 20:41:27 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@operamail.com> | 2013-09-20 20:41:27 +0200 |
| commit | 8cb264e804ee160a8332284a87e5cb51d987a022 (patch) | |
| tree | 2070ec3430ae42db507f46f4d226e0ea93c3e4b0 /src/editor.py | |
| parent | wrapping complete, but not history tracking implemented (diff) | |
| download | pytagomacs-8cb264e804ee160a8332284a87e5cb51d987a022.tar.gz pytagomacs-8cb264e804ee160a8332284a87e5cb51d987a022.tar.bz2 pytagomacs-8cb264e804ee160a8332284a87e5cb51d987a022.tar.xz | |
todos
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/editor.py')
| -rw-r--r-- | src/editor.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/editor.py b/src/editor.py index f1007b1..2f1898b 100644 --- a/src/editor.py +++ b/src/editor.py @@ -51,18 +51,22 @@ _yank, _yank_cycle, _move_point = Line.yank, Line.yank_cycle, Line.move_point _swap_mark, _override = Line.swap_mark, Line.override ## Editing methods to wrap for undo history -def break_edit(self, func): - return func(self) - def full_edit(self, func): - return func(self) + # TODO commit changes, if any + rc = func(self) + # TODO commit changes, if any + # TODO reset + return rc def partial_edit(self, func, with_return = True): + # TODO commit changes, if any, if one second has elapsed, and then reset if with_return: return func(self) else: func(self) +break_edit = lambda self, func : full_edit(self, func) + Line.copy = lambda self : break_edit(self, _copy) Line.cut = lambda self : full_edit(self, _cut) Line.kill = lambda self : full_edit(self, _kill) @@ -357,6 +361,7 @@ class TextArea(): elif d == ctrl('Y'): edit(lambda L : L.yank(), _('Killring is empty')) elif d == ctrl('R'): self.editring.change_direction() elif d in (ctrl('_'), ctrl('U')): + ## TODO history break if self.editring.is_empty(): self.alert(_('Nothing to undo')) else: |
