diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2022-02-07 13:13:38 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2022-02-07 14:06:55 +0000 |
| commit | ef522e292faccff82fde76bd4b4c65cf211a93ae (patch) | |
| tree | 267f6e6df76cff10d0d55aca72cd90b17227bdae /foot-server@.socket | |
| parent | grid: reflow: add TODO to detect selection on re-used rows, and cancel it (diff) | |
selection: foreach: sort start/end based on their scrollback-start relative values
When iterating the characters in a selection, we want to go from the
“start” to the “end”, where start is the upper left-most character,
and “end” is the lower right-most character.
There are two things to consider:
* The ‘start’ coordinate may actually sort after the ‘end’
coordinate (user selected from bottom of the window and upward)
* The scrollback wraparound.
What we do is calculate both the star and end coordinates’
scrollback-start relative row numbers. That is, the number of rows
from the beginning of the scrollback. So if the very first
row (i.e. the oldest) in the scrollback is selected, that has the
scrollback-start relative number “0”.
Then we loop from whichever (start or end coordinate) is highest up in
the scrollback, to the “other” coordinate.
Diffstat (limited to 'foot-server@.socket')
0 files changed, 0 insertions, 0 deletions
