jdx / demand

prompt library for rust
https://docs.rs/demand
MIT License
52 stars 3 forks source link

remove leading space from rendered output #55

Closed roele closed 3 months ago

roele commented 4 months ago

Currently components print their result with a leading space in front of every line.

Screenshot 2024-05-15 at 15 02 37

Apart from not providing much visual value it also complicates code a bit since that space needs to be accounted for on every new line that is rendered.

IMO this leading space should be removed.

yk-amarly-20 commented 3 months ago

Hello, @roele @jdx ! May I work on this issue?

I tried running the example, and I understand that this issue has not yet been resolved.

I understand that fixing around this area and the tests, for example, the Confirm struct, would address this. https://github.com/jdx/demand/blob/9542af2b7888609cb6f6678a439dc7f6d0ac9306/src/confirm.rs#L139

roele commented 3 months ago

Hi @yk-amarly-20 Help around this would be much appreciated since i currently don't have much time on my hands.

The issue affects pretty much all input types of which Input might be a bit more involved with the cursor handling.

For example: https://github.com/jdx/demand/blob/9542af2b7888609cb6f6678a439dc7f6d0ac9306/src/input.rs#L447

If you have any questions don't hesitate to reach out.