Merge branch 'master' into wordWrappingEndOfScreenBell

This commit is contained in:
chrys
2016-11-08 00:07:24 +01:00
5 changed files with 110 additions and 10 deletions

View File

@ -16,7 +16,7 @@ class command():
return 'enables or disables tracking of highlighted'
def run(self):
currMode=self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight')
currMode = self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight')
self.env['runtime']['settingsManager'].setSetting('focus', 'highlight', str(not currMode))
self.env['runtime']['settingsManager'].setSetting('focus', 'cursor', str(currMode))

View File

@ -53,7 +53,7 @@ settings = {
'dateFormat': '%A, %B %d, %Y',
'autoSpellCheck': False,
'spellCheckLanguage': 'en_US',
'scriptPath':'/etc/fenrir/scripts',
'scriptPath':'/usr/share/fenrir/scripts',
},
'focus':{
'cursor': True,

View File

@ -32,19 +32,23 @@ def trackHighlights(oldAttr, newAttr, text, lenght):
old = splitEvery(oldAttr,lenght)
new = splitEvery(newAttr,lenght)
textLines = text.split('\n')
background = []
if len(textLines) != len(new):
return result, currCursor
try:
background = Counter(newAttr).most_common(1)
background = background[0][0]
bgStat = Counter(newAttr).most_common(3)
background.append(bgStat[0][0])
# if there is a third color add a secondary background (for dialogs for example)
if len(bgStat) > 2:
if bgStat[1][1] > 40:
background.append(bgStat[1][0])
except Exception as e:
background = chr(7)
background.append(chr(7))
for line in range(len(new)):
if old[line] != new[line]:
for column in range(len(new[line])):
if old[line][column] != new[line][column]:
if new[line][column] != background:
if not new[line][column] in background:
if not currCursor:
currCursor = {}
currCursor['x'] = column