6 ms·
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. A
by dexen 2y ago
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.
- gcassie 2y agoI 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.
- danhau 2y agoWhat is Acme in this context? Id like to get an idea of what you mean.
- RACEWAR 2y agohttps://plan9.io/sys/doc/acme/acme.html https://plan9.io/sys/doc/acme/acme.html
- danhau 2y agoThanks!
- tomjakubowski 2y agothe acme text editor, originally from plan9 http://acme.cat-v.org/ http://acme.cat-v.org/ https://www.youtube.com/watch?v=dP1xVpMPn8M https://www.youtube.com/watch?v=dP1xVpMPn8M
- danhau 2y agoThank you!