more modernizing commands
This commit is contained in:
@ -14,17 +14,17 @@ class command():
|
||||
def run(self, environment):
|
||||
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'wordEcho'):
|
||||
return
|
||||
|
||||
|
||||
# just when cursor move worddetection is needed
|
||||
if environment['screenData']['newCursor']['x'] == environment['screenData']['oldCursor']['x']:
|
||||
return
|
||||
|
||||
|
||||
# for now no new line
|
||||
if environment['screenData']['newCursor']['y'] != environment['screenData']['oldCursor']['y']:
|
||||
return environment
|
||||
return
|
||||
if len(environment['screenData']['newDelta']) > 1:
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
# TTY Change is no new word
|
||||
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
|
||||
return
|
||||
@ -32,17 +32,17 @@ class command():
|
||||
# first place could not be the end of a word
|
||||
if environment['screenData']['newCursor']['x'] == 0:
|
||||
return
|
||||
|
||||
|
||||
# get the word
|
||||
newContent = environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']]
|
||||
x, y, currWord = word_utils.getCurrentWord(environment['screenData']['newCursor']['x'], 0, newContent)
|
||||
# was this a typed word?
|
||||
if environment['screenData']['newDelta'] != '':
|
||||
if not(newContent[environment['screenData']['oldCursor']['x']].strip() == '' and x != environment['screenData']['oldCursor']['x']):
|
||||
if not(newContent[environment['screenData']['oldCursor']['x']].strip(" \t\n") == '' and x != environment['screenData']['oldCursor']['x']):
|
||||
return
|
||||
else:
|
||||
# or just arrow arround?
|
||||
if not(newContent[environment['screenData']['newCursor']['x']].strip() == '' and x != environment['screenData']['newCursor']['x']):
|
||||
if not(newContent[environment['screenData']['newCursor']['x']].strip(" \t\n") == '' and x != environment['screenData']['newCursor']['x']):
|
||||
return
|
||||
|
||||
if currWord != '':
|
||||
|
@ -54,11 +54,11 @@ class command():
|
||||
x, y, currWord = word_utils.getCurrentWord(environment['screenData']['newCursor']['x'], 0, newContent)
|
||||
# was this a typed word?
|
||||
if environment['screenData']['newDelta'] != '':
|
||||
if not(newContent[environment['screenData']['oldCursor']['x']].strip() == '' and x != environment['screenData']['oldCursor']['x']):
|
||||
if not(newContent[environment['screenData']['oldCursor']['x']].strip(" \t\n") == '' and x != environment['screenData']['oldCursor']['x']):
|
||||
return
|
||||
else:
|
||||
# or just arrow arround?
|
||||
if not(newContent[environment['screenData']['newCursor']['x']].strip() == '' and x != environment['screenData']['newCursor']['x']):
|
||||
if not(newContent[environment['screenData']['newCursor']['x']].strip(" \t\n") == '' and x != environment['screenData']['newCursor']['x']):
|
||||
return
|
||||
|
||||
if currWord != '':
|
||||
|
@ -14,6 +14,8 @@ class command():
|
||||
def run(self, environment):
|
||||
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'promote', 'enabled'):
|
||||
return
|
||||
if environment['runtime']['settingsManager'].getSetting(environment, 'promote', 'list').strip(" \t\n") == '':
|
||||
return
|
||||
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
|
||||
return
|
||||
if environment['screenData']['newDelta'] == '':
|
||||
|
Reference in New Issue
Block a user