remove re.sub
This commit is contained in:
parent
553f5dc456
commit
09a07ab11e
@ -24,8 +24,9 @@ class command():
|
||||
return
|
||||
|
||||
# More than just a deletion happend
|
||||
if self.env['runtime']['screenManager'].isDelta():
|
||||
if self.env['runtime']['screenManager'].isDelta(ignoreSpace=True):
|
||||
return
|
||||
|
||||
# no deletion
|
||||
if not self.env['runtime']['screenManager'].isNegativeDelta():
|
||||
return
|
||||
@ -33,7 +34,8 @@ class command():
|
||||
# too much for a single backspace...
|
||||
# word begin produce a diff wiht len == 2 |a | others with 1 |a|
|
||||
if len(self.env['screen']['newNegativeDelta']) > 2:
|
||||
return
|
||||
return
|
||||
|
||||
currNegativeDelta = self.env['screen']['newNegativeDelta']
|
||||
if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \
|
||||
currNegativeDelta.strip() != '':
|
||||
|
@ -66,8 +66,11 @@ class screenManager():
|
||||
if not self.env['screen']['oldTTY']:
|
||||
return False
|
||||
return self.env['screen']['newTTY'] != self.env['screen']['oldTTY']
|
||||
def isDelta(self):
|
||||
return self.env['screen']['newDelta'] != ''
|
||||
def isDelta(self, ignoreSpace=False):
|
||||
newDelta = self.env['screen']['newDelta']
|
||||
if ignoreSpace:
|
||||
newDelta = newDelta.strip()
|
||||
return newDelta != ''
|
||||
def isNegativeDelta(self):
|
||||
return self.env['screen']['newNegativeDelta'] != ''
|
||||
def getWindowAreaInText(self, text):
|
||||
|
@ -348,9 +348,9 @@ class driver(screenDriver):
|
||||
if cursorLineEnd > cursorLineStart + self.env['screen']['newCursor']['x'] + 3:
|
||||
cursorLineEndOffset = cursorLineStart + self.env['screen']['newCursor']['x'] + 3
|
||||
oldScreenText = self.env['screen']['oldContentText'][cursorLineStartOffset:cursorLineEndOffset]
|
||||
oldScreenText = re.sub(' +',' ',oldScreenText)
|
||||
# oldScreenText = re.sub(' +',' ',oldScreenText)
|
||||
newScreenText = self.env['screen']['newContentText'][cursorLineStartOffset:cursorLineEndOffset]
|
||||
newScreenText = re.sub(' +',' ',newScreenText)
|
||||
#newScreenText = re.sub(' +',' ',newScreenText)
|
||||
diff = difflib.ndiff(oldScreenText, newScreenText)
|
||||
typing = True
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user