Skip to content

Commit 99220d7

Browse files
committed
fix python3 index stuff
1 parent 39e65a0 commit 99220d7

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/format.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,9 @@ def updateDecoratedMatch(self, maxLen=None):
174174
# decorated match and glue them together with our
175175
# truncation decorator
176176
spaceAllowed = maxLen - len(self.TRUNCATE_DECORATOR)
177-
beginMatch = plainText[0:(spaceAllowed / 2)]
178-
endMatch = plainText[-(spaceAllowed / 2):]
177+
midPoint = int(spaceAllowed / 2)
178+
beginMatch = plainText[0:midPoint]
179+
endMatch = plainText[-midPoint:len(plainText)]
179180
plainText = beginMatch + self.TRUNCATE_DECORATOR + endMatch
180181

181182
self.decoratedMatch = FormattedText(

0 commit comments

Comments
 (0)