add new command cursor_position

This commit is contained in:
chrys
2016-08-28 19:19:55 +02:00
parent 49aebcec80
commit 0080e1aeb8
8 changed files with 27 additions and 3 deletions

View File

@ -7,7 +7,7 @@ class command():
pass
def run(self, environment):
# Prefer review cursor over text cursor
if (environment['screenData']['newCursorReview'] != None)
if (environment['screenData']['newCursorReview'] != None):
cursorPos = environment['screenData']['newCursorReview'].copy()
else:
cursorPos = environment['screenData']['newCursor'].copy()

View File

@ -7,7 +7,7 @@ class command():
pass
def run(self, environment):
# Prefer review cursor over text cursor
if (environment['screenData']['newCursorReview'] != None)
if (environment['screenData']['newCursorReview'] != None):
cursorPos = environment['screenData']['newCursorReview'].copy()
else:
cursorPos = environment['screenData']['newCursor'].copy()

View File

@ -0,0 +1,20 @@
#!/bin/python
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()
environment['runtime']['outputManager'].presentText(environment, "line "+ str(cursorPos['y']+1) + " column "+ str(cursorPos['x']+1), interrupt=True)
return environment
def setCallback(self, callback):
pass
def shutdown(self):
pass

View File

@ -12,4 +12,4 @@ class command():
def setCallback(self, callback):
pass
def shutdown(self):
pass
pass

View File

@ -24,6 +24,7 @@ class commandManager():
spec.loader.exec_module(command_mod)
environment['commands'][section][fileName] = command_mod.command()
except Exception as e:
print(e)
environment['runtime']['debug'].writeDebugOut(environment,"Error while loading command:" + currCommand ,debug.debugLevel.ERROR)
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
continue