make typing echo more useful
This commit is contained in:
parent
027be8a80b
commit
659e99d810
@ -8,7 +8,8 @@ class command():
|
||||
environment['screenData']['newCursor']['x'] == environment['screenData']['oldCursor']['x']:
|
||||
return environment
|
||||
if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']].replace(" ","").replace("\n","").replace("\t","") == '':
|
||||
environment['runtime']['outputManager'].presentText(environment, "blank",True)
|
||||
pass
|
||||
#environment['runtime']['outputManager'].presentText(environment, "blank",True)
|
||||
else:
|
||||
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']],True)
|
||||
|
||||
|
@ -48,10 +48,10 @@ class screen():
|
||||
environment['screenData']['newCursor']['x'] = int( environment['screenData']['newContentBytes'][2])
|
||||
environment['screenData']['newCursor']['y'] = int( environment['screenData']['newContentBytes'][3])
|
||||
# analyze content
|
||||
environment['screenData']['newContentText'] = str(environment['screenData']['newContentBytes'][4:][::2].decode("ascii", "replace"))
|
||||
environment['screenData']['newContentText'] = str(environment['screenData']['newContentBytes'][4:][::2].decode("CP1252", "replace"))
|
||||
environment['screenData']['newContentAttrib'] = environment['screenData']['newContentBytes'][5:][::2]
|
||||
environment['screenData']['newContentText'] = '\n'.join(self.textWrapper.wrap(environment['screenData']['newContentText'], ))[:-2]
|
||||
|
||||
|
||||
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
|
||||
self.textWrapper.width = environment['screenData']['columns']
|
||||
environment['screenData']['oldContentBytes'] = b''
|
||||
@ -68,4 +68,5 @@ class screen():
|
||||
diff = difflib.ndiff(" ".join(environment['screenData']['oldContentText'].split()), " ".join(environment['screenData']['newContentText'].split()))
|
||||
environment['screenData']['newDelta'] = ''.join(x[2:] for x in diff if x.startswith('+ '))
|
||||
|
||||
|
||||
return environment
|
||||
|
Loading…
Reference in New Issue
Block a user