Skip to content

Commit a61ad5d

Browse files
author
Cyrille Bougot
committed
Fix skim reading issue
1 parent ee365d5 commit a61ad5d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

source/globalCommands.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5169,11 +5169,10 @@ def script_repeatLastSpokenInformation(self, gesture: "inputCore.InputGesture")
51695169
lastSpeech = speech.speech._lastSpeech
51705170
if lastSpeech is None:
51715171
return
5172-
lastSpeechSeq, symbolLevel = lastSpeech
5172+
lastSpeechText, symbolLevel = lastSpeech
51735173
repeats = scriptHandler.getLastScriptRepeatCount()
5174-
lastSpeechText = " ".join(i for i in lastSpeechSeq if isinstance(i, str))
51755174
if repeats == 0:
5176-
speech.speak(lastSpeechSeq, symbolLevel=symbolLevel)
5175+
speech.speak([lastSpeechText], symbolLevel=symbolLevel)
51775176
braille.handler.message(lastSpeechText)
51785177
elif repeats == 1:
51795178
# Translators: title for report last spoken information dialog.

source/speech/speech.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
_speechState: Optional["SpeechState"] = None
8888
_curWordChars: List[str] = []
8989
IDEOGRAPHIC_COMMA: Final[str] = "\u3001"
90-
_lastSpeech: tuple[SpeechSequence, characterProcessing.SymbolLevel | None] | None = None
90+
_lastSpeech: tuple[str, characterProcessing.SymbolLevel | None] | None = None
9191
"""Last spoken text and the symbol level with which it was spoken."""
9292

9393

@@ -149,9 +149,10 @@ def _setLastSpeechString(
149149
priority: Spri,
150150
):
151151
# Check if the speech sequence contains text to speak
152-
if [item for item in speechSequence if isinstance(item, str)]:
152+
if any(isinstance(item, str) for item in speechSequence):
153153
global _lastSpeech
154-
_lastSpeech = speechSequence, symbolLevel
154+
lastSpeechText = " ".join(i for i in speechSequence if isinstance(i, str))
155+
_lastSpeech = lastSpeechText, symbolLevel
155156

156157

157158
def initialize():

0 commit comments

Comments
 (0)