From 9ab9b55e867d6a1408c206aef330131fbb054cf8 Mon Sep 17 00:00:00 2001 From: chrys Date: Sun, 10 Jun 2018 20:00:14 +0200 Subject: [PATCH] fix bug --- src/fenrirscreenreader/core/textManager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fenrirscreenreader/core/textManager.py b/src/fenrirscreenreader/core/textManager.py index 8a81d7f2..5126b7be 100644 --- a/src/fenrirscreenreader/core/textManager.py +++ b/src/fenrirscreenreader/core/textManager.py @@ -24,11 +24,15 @@ class textManager(): if line[:offset + 1].count('│') > line[offset + 1:].count('│'): offset = xCursor - 1 start = line[:offset + 1].rfind('│') + 1 - end = line[offset + 1:].find('│') + offset + 1 + end = line[offset + 1:].find('│') + if start == end: + return line if start == -1: return line if end == -1: return line + else: + end += offset + 1 if not self.hasBarrier(start, end): return line return line[start:end]