respect hilight mode on enter review

This commit is contained in:
chrys 2016-11-05 00:11:54 +01:00
parent def9341ac1
commit 0407d39a3a
4 changed files with 13 additions and 7 deletions

View File

@ -19,6 +19,8 @@ class command():
def run(self):
if self.env['runtime']['inputManager'].noKeyPressed():
return
if self.env['screenData']['newAttribDelta'] != '':
return
if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']:
return
if self.env['screenData']['newCursor']['y'] != self.env['screenData']['oldCursor']['y']:

View File

@ -56,6 +56,11 @@ class cursorManager():
self.env['screenData']['oldCursorReview'] = self.env['screenData']['newCursorReview']
if not self.env['screenData']['newCursorReview']:
self.env['screenData']['newCursorReview'] = self.env['screenData']['newCursor'].copy()
if self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight') and \
self.env['screenData']['newCursorAttrib'] != None:
if self.env['screenData']['newCursorAttrib']['x'] != 0 and \
self.env['screenData']['newCursorAttrib']['y'] != 0:
self.env['screenData']['newCursorReview'] = self.env['screenData']['newCursorAttrib'].copy()
def setReviewCursorPosition(self, x, y):
if not self.isReviewMode():
self.enterReviewModeCurrTextCursor()

View File

@ -85,6 +85,8 @@ class driver():
self.env['screenData']['oldContentText'] = self.env['screenData']['newContentText']
self.env['screenData']['oldContentAttrib'] = self.env['screenData']['newContentAttrib']
self.env['screenData']['oldCursor'] = self.env['screenData']['newCursor'].copy()
if self.env['screenData']['newCursorAttrib']:
self.env['screenData']['oldCursorAttrib'] = self.env['screenData']['newCursorAttrib'].copy()
self.env['screenData']['oldDelta'] = self.env['screenData']['newDelta']
self.env['screenData']['oldAttribDelta'] = self.env['screenData']['newAttribDelta']
self.env['screenData']['oldNegativeDelta'] = self.env['screenData']['newNegativeDelta']
@ -109,6 +111,7 @@ class driver():
self.env['screenData']['oldDelta'] = ''
self.env['screenData']['oldAttribDelta'] = ''
self.env['screenData']['oldCursorAttrib'] = None
self.env['screenData']['newCursorAttrib'] = None
self.env['screenData']['oldNegativeDelta'] = ''
# initialize current deltas
self.env['screenData']['newNegativeDelta'] = ''
@ -151,6 +154,6 @@ class driver():
# track highlighted
if self.env['screenData']['oldContentAttrib'] != self.env['screenData']['newContentAttrib']:
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight'):
self.env['screenData']['newAttribDelta'], currCursor = screen_utils.trackHighlights(self.env['screenData']['oldContentAttrib'], self.env['screenData']['newContentAttrib'], self.env['screenData']['newContentText'], self.env['screenData']['columns'])
if self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight'):
self.env['screenData']['newAttribDelta'], self.env['screenData']['newCursorAttrib'] = screen_utils.trackHighlights(self.env['screenData']['oldContentAttrib'], self.env['screenData']['newContentAttrib'], self.env['screenData']['newContentText'], self.env['screenData']['columns'])

View File

@ -20,10 +20,6 @@ def insertNewlines(string, every=64):
def splitEvery(string, every=64):
return list(string[i:i+every] for i in range(0, len(string), every))
old = b'eeeemmmeeeeeeeee'
new = b'eeeeeueeeeeeeeee'
text = 'das ist ein test'
def trackHighlights(oldAttr, newAttr, text, lenght):
result = ''
currCursor = None