Skip to content

Commit 952fe7c

Browse files
authored
Merge pull request #41 from wonjaeL/fix-non-eng-lang-bug
Fix bug multiple duplicated characters printed - Non-english languages
2 parents 723cf80 + 361f7b1 commit 952fe7c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

log_viewer/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ def readlines_reverse(qfile, exclude=None):
9191
line = ""
9292
else:
9393
line += next_char
94-
position -= 1
94+
95+
char_length = len(next_char.encode())
96+
if char_length > 1 and len(line) > 3 and len(set(line[-4:-1])) == 1:
97+
line = line[:-3] + next_char
98+
position -= char_length or 1
99+
95100
yield line[::-1]
96101

97102

0 commit comments

Comments
 (0)