improve type detection

This commit is contained in:
chrys 2017-09-25 19:32:46 +02:00
parent 6d93dce61f
commit 8abec664b1

View File

@ -330,15 +330,15 @@ class driver():
oldScreenText = re.sub(' +',' ',self.env['runtime']['screenManager'].getWindowAreaInText(self.env['screen']['oldContentText'])) oldScreenText = re.sub(' +',' ',self.env['runtime']['screenManager'].getWindowAreaInText(self.env['screen']['oldContentText']))
newScreenText = re.sub(' +',' ',self.env['runtime']['screenManager'].getWindowAreaInText(self.env['screen']['newContentText'])) newScreenText = re.sub(' +',' ',self.env['runtime']['screenManager'].getWindowAreaInText(self.env['screen']['newContentText']))
typing = False typing = False
if (self.env['screen']['oldContentText'] != self.env['screen']['newContentText']) and \ if (self.env['screen']['oldContentText'] != self.env['screen']['newContentText']):
(self.env['screen']['newContentText'] != '' ): if self.env['screen']['newContentText'] != '' and self.env['screen']['oldContentText'] == '':
if oldScreenText == '' and\ if oldScreenText == '' and\
newScreenText != '': newScreenText != '':
self.env['screen']['newDelta'] = newScreenText self.env['screen']['newDelta'] = newScreenText
else: else:
cursorLineStart = self.env['screen']['newCursor']['y'] * self.env['screen']['columns'] + self.env['screen']['newCursor']['y'] cursorLineStart = self.env['screen']['newCursor']['y'] * self.env['screen']['columns'] + self.env['screen']['newCursor']['y']
cursorLineEnd = cursorLineStart + self.env['screen']['columns'] cursorLineEnd = cursorLineStart + self.env['screen']['columns']
if self.env['screen']['oldCursor']['x'] != self.env['screen']['newCursor']['x'] and \ if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) == 1 and \
self.env['screen']['oldCursor']['y'] == self.env['screen']['newCursor']['y'] and \ self.env['screen']['oldCursor']['y'] == self.env['screen']['newCursor']['y'] and \
self.env['screen']['newContentText'][:cursorLineStart] == self.env['screen']['oldContentText'][:cursorLineStart]: self.env['screen']['newContentText'][:cursorLineStart] == self.env['screen']['oldContentText'][:cursorLineStart]:
cursorLineStartOffset = cursorLineStart cursorLineStartOffset = cursorLineStart