remove hack that may cause a bug
This commit is contained in:
parent
1998ca15e8
commit
b0c43e26a2
@ -71,25 +71,21 @@ class screen():
|
|||||||
# changes on the screen
|
# changes on the screen
|
||||||
if (environment['screenData']['oldContentText'] != environment['screenData']['newContentText']) and \
|
if (environment['screenData']['oldContentText'] != environment['screenData']['newContentText']) and \
|
||||||
(environment['screenData']['newContentText'] != '' ):
|
(environment['screenData']['newContentText'] != '' ):
|
||||||
if environment['screenData']['oldContentText'] == '' and\
|
diffStart = 0
|
||||||
environment['screenData']['newContentText'] != '':
|
if environment['screenData']['oldCursor']['x'] != environment['screenData']['newCursor']['x'] and \
|
||||||
environment['screenData']['newDelta'] = environment['screenData']['newContentText']
|
environment['screenData']['oldCursor']['y'] == environment['screenData']['newCursor']['y'] and \
|
||||||
|
environment['screenData']['newContentText'][:environment['screenData']['newCursor']['y']] == environment['screenData']['oldContentText'][:environment['screenData']['newCursor']['y']]:
|
||||||
|
diffStart = environment['screenData']['newCursor']['y'] * environment['screenData']['columns'] + environment['screenData']['newCursor']['y']
|
||||||
|
diff = difflib.ndiff(environment['screenData']['oldContentText'][diffStart:diffStart + environment['screenData']['columns']],\
|
||||||
|
environment['screenData']['newContentText'][diffStart:diffStart + environment['screenData']['columns']])
|
||||||
else:
|
else:
|
||||||
diffStart = 0
|
diff = difflib.ndiff( environment['screenData']['oldContentText'][diffStart:].split('\n'),\
|
||||||
if environment['screenData']['oldCursor']['x'] != environment['screenData']['newCursor']['x'] and \
|
environment['screenData']['newContentText'][diffStart:].split('\n'))
|
||||||
environment['screenData']['oldCursor']['y'] == environment['screenData']['newCursor']['y'] and \
|
|
||||||
environment['screenData']['newContentText'][:environment['screenData']['newCursor']['y']] == environment['screenData']['oldContentText'][:environment['screenData']['newCursor']['y']]:
|
diffList = list(diff)
|
||||||
diffStart = environment['screenData']['newCursor']['y'] * environment['screenData']['columns'] + environment['screenData']['newCursor']['y']
|
|
||||||
diff = difflib.ndiff(environment['screenData']['oldContentText'][diffStart:diffStart + environment['screenData']['columns']],\
|
|
||||||
environment['screenData']['newContentText'][diffStart:diffStart + environment['screenData']['columns']])
|
|
||||||
else:
|
|
||||||
diff = difflib.ndiff( environment['screenData']['oldContentText'][diffStart:].split('\n'),\
|
|
||||||
environment['screenData']['newContentText'][diffStart:].split('\n'))
|
|
||||||
|
|
||||||
diffList = list(diff)
|
|
||||||
|
|
||||||
environment['screenData']['newDelta'] = ''.join(x[2:] for x in diffList if x.startswith('+ '))
|
environment['screenData']['newDelta'] = ''.join(x[2:] for x in diffList if x.startswith('+ '))
|
||||||
environment['screenData']['newNegativeDelta'] = ''.join(x[2:] for x in diffList if x.startswith('- '))
|
environment['screenData']['newNegativeDelta'] = ''.join(x[2:] for x in diffList if x.startswith('- '))
|
||||||
else:
|
else:
|
||||||
environment['screenData']['newNegativeDelta'] = ''
|
environment['screenData']['newNegativeDelta'] = ''
|
||||||
environment['screenData']['newDelta'] = ''
|
environment['screenData']['newDelta'] = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user