fix autoread

This commit is contained in:
chrys
2016-07-19 23:35:29 +02:00
parent 2df75c6978
commit 6161dae6bb
2 changed files with 8 additions and 3 deletions

View File

@ -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('+ '))