Skip to content

Commit

Permalink
format: right padding to OP comment
Browse files Browse the repository at this point in the history
  • Loading branch information
azimut committed May 9, 2023
1 parent c4afda6 commit 422aaac
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion internal/discourse/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ func (o Op) String() (ret string) {
ret += fmt.Sprintf(" self: %s\n", o.thread.url)
ret += fmt.Sprintf(
"\n%s\n\n",
format.FormatHtml2Text(o.message, o.thread.LineWidth, o.thread.LeftPadding),
format.FormatHtml2Text(
o.message,
o.thread.LineWidth-o.thread.LeftPadding,
o.thread.LeftPadding,
),
)
ret += fmt.Sprintf(
"%s - %s \n\n\n",
Expand Down
2 changes: 1 addition & 1 deletion internal/fourchan/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (op Op) String() (ret string) {
if op.comment != "" {
comment, _ := text.WrapLeftPadded(
format.GreenTextIt(op.comment),
int(op.thread.LineWidth),
int(op.thread.LineWidth-op.thread.LeftPadding),
int(op.thread.LeftPadding),
)
ret += comment + "\n"
Expand Down
2 changes: 1 addition & 1 deletion internal/hackernews/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (o Op) String() (ret string) {
}
ret += fmt.Sprintf(" self: %s\n", o.selfUrl)
if o.text != "" {
ret += fmt.Sprintf("\n%s\n", fixupComment(o.text, 3, o.thread.LineWidth))
ret += fmt.Sprintf("\n%s\n", fixupComment(o.text, 3, o.thread.LineWidth-3))
}
ret += fmt.Sprintf(
"\n%s(%d) - %s - %d Comments\n",
Expand Down
6 changes: 5 additions & 1 deletion internal/lobsters/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ func (o Op) String() (ret string) {
if o.message != "" {
ret += fmt.Sprintf(
"\n%s\n\n",
format.FormatText(o.message, o.thread.LineWidth, o.thread.LeftPadding),
format.FormatText(
o.message,
o.thread.LineWidth-o.thread.LeftPadding,
o.thread.LeftPadding,
),
)
}
ret += fmt.Sprintf(
Expand Down
2 changes: 1 addition & 1 deletion internal/vichan/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (op Op) String() (ret string) {
if op.message != "" {
ret += "\n" + format.FormatHtml2Text(
op.message,
op.thread.LineWidth,
op.thread.LineWidth-op.thread.LeftPadding,
op.thread.LeftPadding,
)
ret += "\n\n"
Expand Down

0 comments on commit 422aaac

Please sign in to comment.