Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line breaks when under-padding #22

Open
gbelouze opened this issue Jul 1, 2021 · 0 comments
Open

Line breaks when under-padding #22

gbelouze opened this issue Jul 1, 2021 · 0 comments

Comments

@gbelouze
Copy link

gbelouze commented Jul 1, 2021

Using padding functions Line.lpad and Line.rpad with a padding smaller than the segment messes up the line width computation : the code

open Progress
let () = 
    let reporter = Line.(list [const "Foo" |> rpad 2 ; bar 1_000]) in
    Progress.with_reporter reporter @@ fun reporter ->
        for _ = 1 to 100 do reporter 1 ; Unix.sleepf  0.01 done

produces the output

Foo [-------------------------------------------------------------------------
Foo [#------------------------------------------------------------------------
Foo [##-----------------------------------------------------------------------
Foo [###----------------------------------------------------------------------
Foo [####---------------------------------------------------------------------
Foo [#####--------------------------------------------------------------------
]

It could be desired for the semantics of padding to be "pad if smaller, ignore otherwise" instead ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant