add new command cursor_position
This commit is contained in:
parent
49aebcec80
commit
0080e1aeb8
@ -9,6 +9,7 @@
|
||||
1-KEY_KP2=curr_char
|
||||
1-KEY_KP1=prev_char
|
||||
1-KEY_KP3=next_char
|
||||
#=cursor_position
|
||||
1-KEY_KPDOT=exit_review
|
||||
#=curr_screen
|
||||
#=curr_screen_before_cursor
|
||||
|
@ -10,6 +10,7 @@
|
||||
1-KEY_m=prev_char
|
||||
1-KEY_DOT=next_char
|
||||
1-KEY_SLASH=exit_review
|
||||
#=cursor_position
|
||||
#=curr_screen
|
||||
#=curr_screen_before_cursor
|
||||
#=curr_screen_after_cursor
|
||||
|
@ -10,6 +10,7 @@
|
||||
1-FENRIR,1-KEY_KP1=prev_char
|
||||
1-FENRIR,1-KEY_KP3=next_char
|
||||
1-FENRIR,1-KEY_KPDOT=exit_review
|
||||
1-FENRIR,1-KEY_J=cursor_position
|
||||
#=curr_screen
|
||||
#=curr_screen_before_cursor
|
||||
#=curr_screen_after_cursor
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
20
src/fenrir-package/commands/commands/cursor_position.py
Normal file
20
src/fenrir-package/commands/commands/cursor_position.py
Normal 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
|
@ -12,4 +12,4 @@ class command():
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
def shutdown(self):
|
||||
pass
|
||||
pass
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user