diff options
| author | Mattias Andrée <maandree@operamail.com> | 2013-09-09 05:46:56 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@operamail.com> | 2013-09-09 05:46:56 +0200 |
| commit | 201a363e5b4e47a390e93a8fa3f1a54369dd0781 (patch) | |
| tree | 5dd9c0d1b3f08b7f62dabd45daf11db92d10ca51 /src/editor.py | |
| parent | use a functor for jumping (diff) | |
| download | pytagomacs-201a363e5b4e47a390e93a8fa3f1a54369dd0781.tar.gz pytagomacs-201a363e5b4e47a390e93a8fa3f1a54369dd0781.tar.bz2 pytagomacs-201a363e5b4e47a390e93a8fa3f1a54369dd0781.tar.xz | |
m cleanup
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/editor.py')
| -rw-r--r-- | src/editor.py | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/src/editor.py b/src/editor.py index a1225bf..288a559 100644 --- a/src/editor.py +++ b/src/editor.py @@ -345,18 +345,10 @@ class TextArea(): if self.alerted: self.alert(None) if d == ctrl('@'): - if self.mark is None: - self.mark = self.x - self.alert('Mark set') - elif self.mark == ~(self.x): - self.mark = self.x - self.alert('Mark activated') - elif self.mark == self.x: - self.mark = ~(self.x) - self.alert('Mark deactivated') - else: - self.mark = self.x - self.alert('Mark set') + if self.mark is None: self.mark = self.x ; self.alert('Mark set') + elif self.mark == ~(self.x): self.mark = self.x ; self.alert('Mark activated') + elif self.mark == self.x: self.mark = ~(self.x) ; self.alert('Mark deactivated') + else: self.mark = self.x ; self.alert('Mark set') elif d == ctrl('K'): if not self.lines[self.y].kill(): self.alert('At end') @@ -450,27 +442,19 @@ class TextArea(): self.alert('At last line') else: stored = ctrl('N') - elif d == 'C': - stored = ctrl('F') - elif d == 'D': - stored = ctrl('B') + elif d == 'C': stored = ctrl('F') + elif d == 'D': stored = ctrl('B') elif d == '2': d = sys.stdin.read(1) if d == '~': override = not override self.status(('modified' if modified else 'unmodified') + (' override' if override else '')) elif d == '3': - d = sys.stdin.read(1) - if d == '~': - stored = ctrl('D') + if sys.stdin.read(1) == '~': stored = ctrl('D') elif d == '1': - d = sys.stdin.read(1) - if d == '~': - stored = ctrl('A') + if sys.stdin.read(1) == '~': stored = ctrl('A') elif d == '4': - d = sys.stdin.read(1) - if d == '~': - stored = ctrl('E') + if sys.stdin.read(1) == '~': stored = ctrl('E') else: while True: d = sys.stdin.read(1) |
