Permalink
Browse files

j and k fixed issue #99

  • Loading branch information...
1 parent f11d5cb commit a4f5d0f8aa2504caa62b57d81b01088a14aeea5e @Nic0 committed Dec 1, 2011
Showing with 21 additions and 0 deletions.
  1. +8 −0 src/tyrs/interface.py
  2. +4 −0 src/tyrs/keys.py
  3. +9 −0 src/tyrs/timeline.py
View
@@ -186,5 +186,13 @@ def update_last_read_home(self):
def current_user_info(self):
User(self.current_status().user)
+ def go_up(self):
+ timeline = self.select_current_timeline()
+ timeline.go_up()
+
+ def go_down(self):
+ timeline = self.select_current_timeline()
+ timeline.go_down()
+
def beep(self):
return curses.beep()
View
@@ -44,6 +44,10 @@ def keystroke (self, ch):
# left
elif ch == self.conf.keys['left'] or ch == 'left':
self.interface.navigate_buffer(-1)
+ elif ch == self.conf.keys['up']:
+ self.interface.go_up()
+ elif ch == self.conf.keys['down']:
+ self.interface.go_down()
# Update
elif ch == self.conf.keys['update']:
self.api.update_timeline(self.interface.buffer)
View
@@ -120,3 +120,12 @@ def empty(self):
def all_read(self):
if self.count > 0:
self.last_read = self.walker[0].id
+
+ def go_up(self):
+ focus_status, pos = self.walker.get_focus()
+ if pos > 0:
+ self.timeline.set_focus(pos-1)
+
+ def go_down(self):
+ focus_status, pos = self.walker.get_focus()
+ self.timeline.set_focus(pos+1)

0 comments on commit a4f5d0f

Please sign in to comment.