Fix shift bug in ANSIString.__mult__. Resolves #2030
This commit is contained in:
parent
f41034e6a7
commit
6c3a7367ab
1 changed files with 3 additions and 1 deletions
|
|
@ -821,6 +821,8 @@ class ANSIString(str, metaclass=ANSIMeta):
|
||||||
by a number.
|
by a number.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
if not offset:
|
||||||
|
return []
|
||||||
return [i + offset for i in iterable]
|
return [i + offset for i in iterable]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
@ -1063,7 +1065,7 @@ class ANSIString(str, metaclass=ANSIMeta):
|
||||||
clean_string = self._clean_string * other
|
clean_string = self._clean_string * other
|
||||||
code_indexes = self._code_indexes[:]
|
code_indexes = self._code_indexes[:]
|
||||||
char_indexes = self._char_indexes[:]
|
char_indexes = self._char_indexes[:]
|
||||||
for i in range(1, other + 1):
|
for i in range(other):
|
||||||
code_indexes.extend(self._shifter(self._code_indexes, i * len(self._raw_string)))
|
code_indexes.extend(self._shifter(self._code_indexes, i * len(self._raw_string)))
|
||||||
char_indexes.extend(self._shifter(self._char_indexes, i * len(self._raw_string)))
|
char_indexes.extend(self._shifter(self._char_indexes, i * len(self._raw_string)))
|
||||||
return ANSIString(
|
return ANSIString(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue