fix autoread
This commit is contained in:
parent
2df75c6978
commit
6161dae6bb
@ -5,12 +5,15 @@ class command():
|
||||
pass
|
||||
def run(self, environment):
|
||||
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'charEcho') and\
|
||||
environment['screenData']['newCursor'] - environment['screenData']['oldCursor'] ==1:
|
||||
environment['screenData']['newCursor']['x'] - environment['screenData']['oldCursor']['x'] ==1:
|
||||
return environment
|
||||
|
||||
ttyChanged = environment['screenData']['newTTY'] != environment['screenData']['oldTTY']
|
||||
if environment['screenData']['newDelta'] == environment['screenData']['oldDelta'] and \
|
||||
not ttyChanged:
|
||||
return environment
|
||||
print(environment['screenData']['newDelta'])
|
||||
|
||||
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], ttyChanged)
|
||||
return environment
|
||||
def setCallback(self, callback):
|
||||
|
@ -67,9 +67,11 @@ class screen():
|
||||
environment['screenData']['newDelta'] = environment['screenData']['newContentText']
|
||||
else:
|
||||
diffStart = 0
|
||||
lastLine = len(environment['screenData']['newDelta']) - environment['screenData']['columns'] -1
|
||||
if environment['screenData']['newDelta'][:lastLine] == environment['screenData']['oldDelta'][:lastLine]:
|
||||
print(len(environment['screenData']['newContentText']), environment['screenData']['columns'])
|
||||
lastLine = len(environment['screenData']['newContentText']) - environment['screenData']['columns']
|
||||
if environment['screenData']['newContentText'][:lastLine] == environment['screenData']['oldContentText'][:lastLine]:
|
||||
diffStart = lastLine + 1
|
||||
|
||||
diff = difflib.ndiff(" ".join(environment['screenData']['oldContentText'][diffStart:].split(' ')),\
|
||||
" ".join(environment['screenData']['newContentText'][diffStart:].split(' ')))
|
||||
environment['screenData']['newDelta'] = ''.join(x[2:] for x in diff if x.startswith('+ '))
|
||||
|
Loading…
Reference in New Issue
Block a user