I particularly like how in Acme, when selection is zero-width ("empty"), it is the cursor. Conversely selection can be extended from cursor in any direction.
As a side effect, this greatly simplifies the API for manipulating both.
I actually used this pattern as well and I really like it. I store another property called `mark_idx`. When `cursor_idx` and `mark_idx` are the same then it's just a cursor. When they differ, the range between them is the selection.
gcassie|1 year ago
danhau|1 year ago
tomjakubowski|1 year ago
http://acme.cat-v.org/ https://www.youtube.com/watch?v=dP1xVpMPn8M
RACEWAR|1 year ago