diff --git a/src/fenrirscreenreader/core/screenManager.py b/src/fenrirscreenreader/core/screenManager.py index eabbf03d..b3e288b1 100644 --- a/src/fenrirscreenreader/core/screenManager.py +++ b/src/fenrirscreenreader/core/screenManager.py @@ -331,19 +331,25 @@ class ScreenManager: ].rstrip() ) - # If diff doesn't match expected typing pattern, treat - # as general screen change + # Prompt/status repaints can add extra diff text while + # the user's typed characters are still at the cursor. + # Keep those as typing so incoming speech does not + # announce the repainted prompt line. if temp_new_delta != expected_typing: - # Fallback: treat entire current line as new - # content - diff_list = [ - "+ " - + self.env["screen"]["new_content_text"].split( - "\n" - )[self.env["screen"]["new_cursor"]["y"]] - + "\n" - ] - typing = False + if expected_typing.strip() != "": + diff_list = ["+ " + expected_typing] + else: + # Fallback: treat entire current line as new + # content + current_line = self.env["screen"][ + "new_content_text" + ].split("\n")[ + self.env["screen"]["new_cursor"]["y"] + ] + diff_list = [ + "+ " + current_line + "\n" + ] + typing = False else: # GENERAL SCREEN CHANGE DETECTION # Not typing - handle as line-by-line content change