Hopefully improve accuracy of blank line reporting.

This commit is contained in:
Storm Dragon 2025-02-26 16:05:17 -05:00
parent ed918a0334
commit 8cd50c5070
2 changed files with 11 additions and 5 deletions

View File

@ -35,12 +35,18 @@ class command():
if not (self.env['runtime']['byteManager'].getLastByteKey() in [b'^[[A',b'^[[B']):
return
# Get the current cursor's line from both old and new content
prevLine = self.env['screen']['oldContentText'].split('\n')[self.env['screen']['newCursor']['y']]
currLine = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
is_blank = currLine.strip() == ''
if prevLine == currLine:
if self.env['screen']['newDelta'] != '':
return
if not currLine.isspace():
announce = currLine
if not is_blank:
currPrompt = currLine.find('$')
rootPrompt = currLine.find('#')
if currPrompt <= 0:
@ -55,13 +61,13 @@ class command():
else:
announce = currLine
if currLine.isspace():
if is_blank:
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
else:
self.env['runtime']['outputManager'].presentText(announce, interrupt=True, flush=False)
self.env['commandsIgnore']['onScreenUpdate']['CHAR_DELETE_ECHO'] = True
self.env['commandsIgnore']['onScreenUpdate']['CHAR_ECHO'] = True
self.env['commandsIgnore']['onScreenUpdate']['INCOMING_IGNORE'] = True
def setCallback(self, callback):
pass

View File

@ -4,5 +4,5 @@
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
version = "2025.01.08"
codeName = "master"
version = "2025.02.26"
codeName = "testing"