From aa8f4d563eda9fd5e6cd79c740cbc541716fbd77 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Wed, 24 Aug 2016 16:17:42 +0200 Subject: [PATCH] Update marked_text.py --- src/fenrir-package/commands/commands/marked_text.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/fenrir-package/commands/commands/marked_text.py b/src/fenrir-package/commands/commands/marked_text.py index 5c4a3722..6cb68143 100644 --- a/src/fenrir-package/commands/commands/marked_text.py +++ b/src/fenrir-package/commands/commands/marked_text.py @@ -9,9 +9,15 @@ class command(): (environment['commandBuffer']['Marks']['2'] == None): environment['runtime']['outputManager'].presentText(environment, "two marks needed", interrupt=True) return environment - - marked = mark_utils.getTextBetweenMarks(environment['commandBuffer']['Marks']['1'], environment['commandBuffer']['Marks']['2'], environment['screenData']['newContentText'].split('\n')) - print(marked) + + # use the last first and the last setted mark as range + startMark = environment['commandBuffer']['Marks']['1'].copy() + endMark = environment['commandBuffer']['Marks']['2'].copy() + if environment['commandBuffer']['Marks']['3'] != None: + endMark = environment['commandBuffer']['Marks']['3'].copy() + + marked = mark_utils.getTextBetweenMarks(startMark, endMark, environment['screenData']['newContentText'].split('\n')) + if marked.strip(" \t\n") == '': environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True) else: