Closed jbschlosser-zz closed 8 years ago
If you look at PR #15, you'll see that there is already such a simplification proposed. It's not as drastic as yours here, but I'm not sure that getting rid of the Position
type altogether is such a good idea. It complexifies the signature of every function taking a position as an argument and will necessitate a lot of search&replace for all API users if we ever change our mind about a position being represented with usize
.
Ah sorry, I didn't see that proposal at first. Even though I didn't modify any user-facing API calls, I do agree that using a naked tuple for cursor position isn't ideal. I'll change that to use a Position struct.
Looks good to me. Thanks for the PR!
Darn it, I didn't see the conflict there. I'm on my phone right now so I can't be of much help, but I'd love to get this merged today!
Got it merged and it should be good to go!
Just to be sure: we're losing two concepts here.
None
cursor pos.It doesn't seem to me like it's a big deal to lose them (that is, it seems to me that it has no impact whatsoever on the way the library works), but maybe the @cpjreynolds would know better of the implications of those two losses.
@hsoft I may be wrong, it has been a few months since I wrote it, however I am fairly sure the last cursor position was stored to optimize some cursor movement, since if we know the current cursor position is sequential to the last, we won't need to emit an escape sequence to re-position. I'll take a closer look at this to be sure.
I'd like to apologize for essentially abandoning this project for so long, personal issues came up and it has been a rough year to say the least. That being said, the college application nightmare is over and I am going to have all summer to be able to work on this project! I'd like to start back off with a clean slate so I'm going to close this PR for now, however if you would like to revisit this, please do not hesitate to open another PR in the future!
I was experiencing weird behavior with cursor positioning, so I investigated and found that the system of tracking valid/invalid cursor coordinates was not functioning correctly when sending characters. I removed that system entirely and switched to the simplified form of just keeping a tuple for current cursor position. To fix my issue, I rewrote the character sending logic to:
With this in place, my issues are gone. I'm open to any alternatives that still address my issue; this just seemed like the simplest solution.