aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-08-06 03:00:12 +0200
committerMattias Andrée <maandree@operamail.com>2013-08-06 03:00:12 +0200
commit6ac3afaffa2b6d8a29ebf4f829809dcf800074a3 (patch)
tree9b1a0c30375fb69a760b06725ed18fb160b8dd49 /src
parentfix that insert mode visually overrides (diff)
downloadpytagomacs-6ac3afaffa2b6d8a29ebf4f829809dcf800074a3.tar.gz
pytagomacs-6ac3afaffa2b6d8a29ebf4f829809dcf800074a3.tar.bz2
pytagomacs-6ac3afaffa2b6d8a29ebf4f829809dcf800074a3.tar.xz
fix home and end command parsing
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r--src/editor.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/editor.py b/src/editor.py
index 1548fff..048a6f6 100644
--- a/src/editor.py
+++ b/src/editor.py
@@ -380,24 +380,32 @@ class TextArea():
d = sys.stdin.read(1)
if d == '~':
stored = chr(ord('D') - ord('@'))
+ elif d == '1':
+ d = sys.stdin.read(1)
+ if d == '~':
+ stored = chr(ord('A') - ord('@'))
+ elif d == '4':
+ d = sys.stdin.read(1)
+ if d == '~':
+ stored = chr(ord('E') - ord('@'))
else:
while True:
d = sys.stdin.read(1)
if (ord('a') <= ord(d)) and (ord(d) <= ord('z')): break
if (ord('A') <= ord(d)) and (ord(d) <= ord('Z')): break
if d == '~': break
+ elif d == 'O':
+ d = sys.stdin.read(1)
+ if d == 'H':
+ stored = chr(ord('A') - ord('@'))
+ elif d == 'F':
+ stored = chr(ord('E') - ord('@'))
elif (d == 'w') or (d == 'W'):
if not self.lines[self.y].copy():
self.alert('No text is selected')
elif (d == 'y') or (d == 'Y'):
if not self.lines[self.y].yank_cycle():
stored = chr(ord('Y') - ord('@'))
- elif d == 'O':
- d = sys.stdin.read(1)
- if d == 'H':
- storted = chr(ord('A') - ord('@'))
- elif d == 'F':
- storted = chr(ord('E') - ord('@'))
elif d == '\n':
stored = chr(ord('N') - ord('@'))
else: