nncli

NextCloud Notes Command Line Interface
git clone git://git.danielmoch.com/nncli.git
Log | Files | Refs | LICENSE

commit d62f234a4744ad8ae26b643ccfba01dbe76c08c5
parent 073e0c3b94f2b11c52cb749730131db25cc2b445
Author: Samuel Walladge <samuel@swalladge.id.au>
Date:   Thu, 14 Jul 2016 18:17:23 +0930

fix case where focus position isn't an integer value (ie. invalid)

Diffstat:
Msimplenote_cli/sncli.py | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/simplenote_cli/sncli.py b/simplenote_cli/sncli.py @@ -465,7 +465,7 @@ def gui_frame_keypress(self, size, key): if len(lb.body.positions()) <= 0: return None last = len(lb.body.positions()) - next_focus = lb.focus_position + (size[1] / 2) + next_focus = lb.focus_position + (size[1] // 2) if next_focus >= last: next_focus = last - 1 lb.change_focus(size, next_focus, @@ -477,9 +477,9 @@ def gui_frame_keypress(self, size, key): return None if 'bottom' in lb.ends_visible(size): last = len(lb.body.positions()) - next_focus = last - size[1] - (size[1] / 2) + next_focus = last - size[1] - (size[1] // 2) else: - next_focus = lb.focus_position - (size[1] / 2) + next_focus = lb.focus_position - (size[1] // 2) if next_focus < 0: next_focus = 0 lb.change_focus(size, next_focus,