make typing echo more useful

This commit is contained in:
chrys 2016-07-17 14:01:55 +02:00
parent 027be8a80b
commit 659e99d810
2 changed files with 5 additions and 3 deletions

View File

@ -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)

View File

@ -48,7 +48,7 @@ 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]
@ -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