You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed that after wrapping, this code is inserting some characters by calling the function ansi_terminate_lines. As it is disturbing the behavior I would expect, I would like to know why this function is being called at the end of the wrap function.
My situation is the following: I have a string s with multiple lines (i.e., multiple '\n') with lots of ANSI code all along. When calling ansiwrap.fill(s, replace_whitespace=False), it does not work properly, as it is breaking the line before the width although the next word in the following line would fill properly in the same line.
Then I decided to split s as s.split('\n') and apply ansiwrap.fill(line) as x = [ansiwrap.fill(line, width=columns) for line in s.split('\n')] for joining the result later: s = '\n'.join(x).
In this case, however, some ANSI code in the previous line that should affect the next line is not affecting anymore. By removing the ansi_terminate_lines it works fine for me.
Thank you for the initiative!
The text was updated successfully, but these errors were encountered:
I have noticed that after wrapping, this code is inserting some characters by calling the function
ansi_terminate_lines
. As it is disturbing the behavior I would expect, I would like to know why this function is being called at the end of thewrap
function.ansiwrap/ansiwrap/core.py
Line 92 in 20e2e8c
My situation is the following: I have a string
s
with multiple lines (i.e., multiple'\n'
) with lots of ANSI code all along. When callingansiwrap.fill(s, replace_whitespace=False)
, it does not work properly, as it is breaking the line before thewidth
although the next word in the following line would fill properly in the same line.Then I decided to split
s
ass.split('\n')
and applyansiwrap.fill(line)
asx = [ansiwrap.fill(line, width=columns) for line in s.split('\n')]
for joining the result later:s = '\n'.join(x)
.In this case, however, some ANSI code in the previous
line
that should affect the nextline
is not affecting anymore. By removing theansi_terminate_lines
it works fine for me.Thank you for the initiative!
The text was updated successfully, but these errors were encountered: