OSDN Git Service

LiveText: When calculating new text, don't barf on empty lines.
authorJames Teh <jamie@jantrid.net>
Tue, 9 Nov 2010 23:04:52 +0000 (09:04 +1000)
committerJames Teh <jamie@jantrid.net>
Tue, 9 Nov 2010 23:04:52 +0000 (09:04 +1000)
source/NVDAObjects/behaviors.py

index 6ea2a3f..784c78a 100755 (executable)
@@ -233,11 +233,11 @@ class LiveText(NVDAObject):
                                prevLine = line\r
                                continue\r
                        text = line[2:]\r
-                       if text.isspace():\r
+                       if not text or text.isspace():\r
                                prevLine = line\r
                                continue\r
 \r
-                       if prevLine and prevLine[0] == "-":\r
+                       if prevLine and prevLine[0] == "-" and len(prevLine) > 2:\r
                                # It's possible that only a few characters have changed in this line.\r
                                # If so, we want to speak just the changed section, rather than the entire line.\r
                                prevText = prevLine[2:]\r