Skip to content

Commit 4068192

Browse files
authored
fmt: avoid space before newline (#910)
* In fmt_line() out-list describes one line of text * Each word keeps a record of trailing spaces after the word (i.e. "suffix" number in the code) * Trailing space should be ignored for the final word on the line because it gets terminated by a newline
1 parent 09cf50b commit 4068192

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

bin/fmt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ sub fmt_line {
147147
my $s = ' ' x $out[0]->{'indent'};
148148
print $s;
149149

150+
$out[-1]->{'suffix'} = 0;
150151
foreach $tok (@out) {
151152
$s = $tok->{'word'};
152153
$s .= ' ' x $tok->{'suffix'};

0 commit comments

Comments
 (0)