From 5ee7874d136f6980d369a7470475f27c2e127b1a Mon Sep 17 00:00:00 2001 From: chrys87 Date: Tue, 19 Jul 2016 10:11:44 +0200 Subject: [PATCH] find last char logic --- src/fenrir-package/commands/commands/prev_char | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/fenrir-package/commands/commands/prev_char b/src/fenrir-package/commands/commands/prev_char index 62e8b05f..d57837b7 100644 --- a/src/fenrir-package/commands/commands/prev_char +++ b/src/fenrir-package/commands/commands/prev_char @@ -7,7 +7,13 @@ class command(): environment['screenData']['oldCursorReview'] = environment['screenData']['newCursorReview'] if environment['screenData']['newCursorReview']['y'] == -1: environment['screenData']['newCursorReview'] = environment['screenData']['newCursor'].copy() - wrappedLines = environment['screenData']['newContentText'].split('\n') + wrappedLines = environment['screenData']['newContentText'].split('\n') + if environment['screenData']['newCursorReview']['x'] - 1 < 0: + if environment['screenData']['newCursorReview']['y'] -1 > 0: + environment['screenData']['newCursorReview']['y'] -= 1 + environment['screenData']['newCursorReview']['x'] = len(wrappedLines[environment['screenData']['newCursorReview']['y']) - 1 + else: + environment['screenData']['newCursorReview']['x'] =- 1 if wrappedLines[environment['screenData']['newCursorReview']['y']][environment['screenData']['newCursorReview']['x']].strip(" \t\n") == '': environment['runtime']['outputManager'].presentText(environment, "blank") else: