[orca] Handle starting flat review when cursor offset is after final character
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Handle starting flat review when cursor offset is after final character
- Date: Fri, 6 Jul 2018 20:08:35 +0000 (UTC)
commit 5da050aac132e30e749c4e875f9d1821e7c3d938
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri Jul 6 16:05:20 2018 -0400
Handle starting flat review when cursor offset is after final character
src/orca/flat_review.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/flat_review.py b/src/orca/flat_review.py
index d3f640301..ebebf8d12 100644
--- a/src/orca/flat_review.py
+++ b/src/orca/flat_review.py
@@ -230,6 +230,10 @@ class Zone:
if offset >= 0:
return word, offset
+ if self.length == charOffset and self.words:
+ lastWord = self.words[-1]
+ return lastWord, lastWord.length
+
return None, -1
def hasCaret(self):
@@ -879,7 +883,10 @@ class Context:
elif zone.words:
current = zone.words[self.wordIndex]
if flatReviewType == Context.CHAR and current.chars:
- current = current.chars[self.charIndex]
+ try:
+ current = current.chars[self.charIndex]
+ except:
+ return None, -1, -1, -1, -1
return current.string, current.x, current.y, current.width, current.height
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]