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
And subsequent_indentcounts towards the line length of each line except the first. In other words, if the terminal is 120 wide and remaining_width = 60, we'll end up passing 120-60 space characters to subsequent_lines, and those will be counted against the remaining_width we pass as the width argument. Which effectively means there is zero remaining space, and so textwrap dutifully wraps the remaining lines as aggressively as it can.
The solution here is probably to not pass subsequent_indent, and instead just prepend the spaces onto each line (except the first) that textwrap.wrap returns.
The text was updated successfully, but these errors were encountered:
jonhoo
added a commit
to jonhoo/kraken-build
that referenced
this issue
Aug 2, 2023
To reproduce:
kraken q ls
.This happens because we use the
subsequent_ident
argument totextwrap.wrap
:https://github.com/kraken-build/kraken-build/blob/fcb55055a56ec703729315b462820cfd363c26bb/kraken-core/src/kraken/core/cli/main.py#L324-L328
And
subsequent_indent
counts towards the line length of each line except the first. In other words, if the terminal is 120 wide andremaining_width = 60
, we'll end up passing 120-60 space characters tosubsequent_lines
, and those will be counted against theremaining_width
we pass as thewidth
argument. Which effectively means there is zero remaining space, and sotextwrap
dutifully wraps the remaining lines as aggressively as it can.The solution here is probably to not pass
subsequent_indent
, and instead just prepend the spaces onto each line (except the first) thattextwrap.wrap
returns.The text was updated successfully, but these errors were encountered: