From 4b175356ffcbe10f2fef6c9fba4da49b00414cec Mon Sep 17 00:00:00 2001 From: chrys Date: Wed, 20 Sep 2017 00:14:13 +0200 Subject: [PATCH] fix offset --- src/fenrir/screenDriver/vcsaDriver.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fenrir/screenDriver/vcsaDriver.py b/src/fenrir/screenDriver/vcsaDriver.py index 81cf878d..c024acd0 100644 --- a/src/fenrir/screenDriver/vcsaDriver.py +++ b/src/fenrir/screenDriver/vcsaDriver.py @@ -337,16 +337,16 @@ class driver(): self.env['screen']['newDelta'] = newScreenText else: 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 \ self.env['screen']['oldCursor']['y'] == self.env['screen']['newCursor']['y'] and \ self.env['screen']['newContentText'][:cursorLineStart] == self.env['screen']['oldContentText'][:cursorLineStart]: cursorLineStartOffset = cursorLineStart cursorLineEndOffset = cursorLineEnd - if (cursorLineStart - 4) > self.env['screen']['newCursor']['y'] * self.env['screen']['columns']: - cursorLineStartOffset = (self.env['screen']['newCursor']['x'] - 4) - if (cursorLineEndOffset + 4) < self.env['screen']['newCursor']['y'] * self.env['screen']['columns'] + self.env['screen']['columns']: - cursorLineEndOffset = (self.env['screen']['newCursor']['x'] + 4) + if cursorLineStart < cursorLineStart + self.env['screen']['newCursor']['x'] - 4: + cursorLineStartOffset = cursorLineStart + self.env['screen']['newCursor']['x'] - 4 + if cursorLineEnd > cursorLineStart + self.env['screen']['newCursor']['x'] + 4: + cursorLineEndOffset = cursorLineStart + self.env['screen']['newCursor']['x'] + 4 oldScreenText = self.env['screen']['oldContentText'][cursorLineStartOffset:cursorLineEndOffset] oldScreenText = re.sub(' +',' ',oldScreenText) newScreenText = self.env['screen']['newContentText'][cursorLineStartOffset:cursorLineEndOffset]