diff --git a/src/fenrir-package/commands/commands/curr_screen_before_cursor b/src/fenrir-package/commands/commands/curr_screen_before_cursor new file mode 100644 index 00000000..2d7d62e3 --- /dev/null +++ b/src/fenrir-package/commands/commands/curr_screen_before_cursor @@ -0,0 +1,25 @@ +#!/bin/python + +from utils import mark_utils + +class command(): + def __init__(self): + pass + def run(self, environment): + # Prefer review cursor over text cursor + if (environment['screenData']['newCursorReview'] != None) + cursorPos = environment['screenData']['newCursorReview'].copy() + else: + cursorPos = environment['screenData']['newCursor'].copy() + + textBeforeCursor = mark_utils.getTextBeforeMark(cursorPos, environment['screenData']['newContentText']) + + if textBeforeCursor.strip() == '': + environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True) + else: + environment['runtime']['outputManager'].presentText(environment, textBeforeCursor, interrupt=True) + return environment + def setCallback(self, callback): + pass + def shutdown(self): + pass