[dev] [st] selection bugfix

From: <p37sitdu_AT_lavabit.com>
Date: Sun, 26 May 2013 14:42:32 +0400

The fix is for st HEAD.

First of all, how to reproduce:
1. Run "man man" or just "less" with some scrollable file.
2. Select some part of text by pressing LMB somewhere and moving cursor
3. Scroll with "j" and "k".

The result is: http://postimg.org/image/ec04tz7u5/

The problem is that if you select this way, sel.e.y is less than
sel.b.x. selected() function expects sel.b.y and sel.e.y to be the
"sorted" version of sel.bx, ..., sel.ey variables.

To fix this problem, I moved the code that sorts these variables to
separate function "selsort" and replaced code that just copied sel.bx,
.., sel.ey to sel.b.x, ..., sel.e.y with the call to selsort.

This also fixes another problem with rectangular selection. If you
select backwards with alt pressed and then scroll, rectangular selection
just disappears.

Patch is attached.

Received on Sun May 26 2013 - 12:42:32 CEST

This archive was generated by hypermail 2.3.0 : Sun May 26 2013 - 12:48:04 CEST