fix issues with barrier
This commit is contained in:
parent
45971a8acc
commit
ed98994241
@ -87,28 +87,27 @@ class barrierManager():
|
|||||||
for b in leftBarriers:
|
for b in leftBarriers:
|
||||||
if line[:offset + 1].count(b) > line[offset:].count(b):
|
if line[:offset + 1].count(b) > line[offset:].count(b):
|
||||||
offset = xCursor - 1
|
offset = xCursor - 1
|
||||||
start = line[:offset + 1].rfind(b)
|
start = line[:offset].rfind(b)
|
||||||
if start != -1:
|
if start != -1:
|
||||||
if not self.hasBorder(text, xCursor, yCursor, leftBarriers, start):
|
if not self.hasBorder(text, xCursor, yCursor, leftBarriers, start):
|
||||||
start = -1
|
start = -1
|
||||||
else:
|
else:
|
||||||
start += 1
|
start += 1
|
||||||
break
|
break
|
||||||
if start == -1:
|
if start == -1:
|
||||||
return False, line
|
return False, line
|
||||||
# end
|
# end
|
||||||
for b in rightBarriers:
|
for b in rightBarriers:
|
||||||
end = line[start + 1:].find(b)
|
end = line[start:].find(b)
|
||||||
if end != -1:
|
if end != -1:
|
||||||
end = start + end
|
end = start + end
|
||||||
if not self.hasBorder(text, xCursor, yCursor,rightBarriers, end + 1):
|
if not self.hasBorder(text, xCursor, yCursor,rightBarriers, end):
|
||||||
end = -1
|
end = -1
|
||||||
break
|
break
|
||||||
if end == -1:
|
if end == -1:
|
||||||
return False, line
|
return False, line
|
||||||
if start == end:
|
if start == end:
|
||||||
return False, line
|
return False, line
|
||||||
end += offset + 1
|
|
||||||
|
|
||||||
return True, line[start:end]
|
return True, line[start:end]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user