-
Notifications
You must be signed in to change notification settings - Fork 280
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
Consider reverting cursor::MoveToColumn(0)
non-zero handling or changing it?
#683
Comments
I think it would make more sense if they were zero indexed because
|
Duplicate of #632 |
I see there is correct confusing how the API operates and in being consistent. The aim is to be 0-based but ANSI codes are often 1-based. I think this is indeed something to be reverted. We should then just increment the parameter by one and accept 0 parametes everywere, in all cursor functions. |
Previous time I thought that it was confusing having Move Left by 0 moves left by 1. But if you see it like: Move left to the zeroth cell then it makes more sense. |
If I'm not mistaken, So in my mind |
So the question becomes do we want all cursor functions to be consistent aka 0-based. Or does it make sense for some functions like moving left/right to be 1-based? But that we properly document it. |
For me it does not make sense to adjust relative moves in this way. Something like "go two steps left" always has the same meaning, no matter if the coordinate system starts at Either way, documenting it properly would be good. |
Yes that was my previous thought as well. Lets do it like that, thus 1 is really moving 1. And document that this is the case rather than being consistent with moveto commands that people were confused by. |
Is your feature request related to a problem? Please describe.
I was using
MoveToColumn(0)
because I assumed it was 0-indexed, but in #627 it was changed to be silently ignored so the output of my code started acting funny when I upgraded crossterm.It seems better to just let
0
be the same as1
forMoveToColumn
? I think some other people might also get confused why it's not working as well and blame crossterm on being buggy.Describe the solution you'd like
MoveToColumn(0)
is equivalent to1
or perhaps panic (maybe only panic in debug)? Alternatively, maybe this should only accept a NonZeroU16, though that api might not be so nice.0
equivalent to1
seems most ideal.I can understand how this current functionality is desired for what's described in #626, but not so much for this.
I guess also
MoveToRow(0)
too actually.The text was updated successfully, but these errors were encountered: