add initial working highlight focus tracking

This commit is contained in:
chrys 2016-11-04 22:23:54 +01:00
parent 6f479a7561
commit a58fe62f87
3 changed files with 5 additions and 3 deletions

View File

@ -17,6 +17,8 @@ class command():
return '' return ''
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
return
if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']: if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']:
return return
if self.env['runtime']['inputManager'].noKeyPressed(): if self.env['runtime']['inputManager'].noKeyPressed():

View File

@ -17,6 +17,8 @@ class command():
return '' return ''
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
return
if self.env['runtime']['inputManager'].noKeyPressed(): if self.env['runtime']['inputManager'].noKeyPressed():
return return
if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']: if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']:

View File

@ -29,9 +29,7 @@ class command():
return return
prevLine = self.env['screenData']['oldContentText'].split('\n')[self.env['screenData']['newCursor']['y']] prevLine = self.env['screenData']['oldContentText'].split('\n')[self.env['screenData']['newCursor']['y']]
currLine = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']] currLine = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']]
if currLine.isspace(): if not currLine.isspace():
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
else:
currPrompt = currLine.find('$') currPrompt = currLine.find('$')
rootPrompt = currLine.find('#') rootPrompt = currLine.find('#')
if currPrompt <= 0: if currPrompt <= 0: