public inbox for goredo-devel@lists.cypherpunks.ru
Atom feed
From: Rin Takanashi <dareka826@gmail•com>
To: goredo-devel@lists.cypherpunks.ru
Subject: What is the purpose of fillUpToTermSize?
Date: Thu, 29 Apr 2021 01:49:59 +0200	[thread overview]
Message-ID: <CAPD4u24rX0CSvCL7D-Na5d-9hsJ6B1hkNNE9d8Km6Uo=V_dgyw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]

Hello,

I was wondering what is the fillUpToTermSize function supposed to do. From
the name it seems to stretch the string with spaces to the terminal's width
but from what I understand it stretches the supplied string to the length
of the longest previously supplied string.

I don't really know why this behavior would be wanted, but I ran into this
function when it caused many newlines (caused by a lot of extra spaces) in
the output of redo after a long line was printed to stderr from one of my
.do files.

Example:
=== all.do
redo-ifchange long
~~~

=== long.do
redo-always

for i in $(seq 1 1 200); do
        printf "$i" >&2
done
~~~

The code above should produce several newlines right after "redo . long"
which result from the extra spaces on this line and the "redo . all" line
is not affected.

When I removed everything but the return statement from this function no
other output seemed to be broken and there were no weird newlines, so
that's why I'm unsure as to this function's purpose.

-Rin

[-- Attachment #2: Type: text/html, Size: 1658 bytes --]

             reply	other threads:[~2021-04-28 23:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28 23:49 Rin Takanashi [this message]
2021-04-29 11:39 ` What is the purpose of fillUpToTermSize? Sergey Matveev