st

simple terminal

git clone https://9o.is/git/st.git

commit 107e904cb3f170043406fb9f84a63f80d023724f
parent 79468064fc7e0f6c5a18eb22af6a28b8d773dd95
Author: Christoph Lohmann <20h@r-36.net>
Date:   Wed, 20 Mar 2013 21:19:28 +0100

Making rectangular selection work again.

People sending me patches against strange revisions and basing on their own
revisions make me having to reapply them. Then such errors appear.

Thanks Alexander Sedov <alex0player@gmail.com> for noticing this.

Diffstat:
Mst.c | 5+----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/st.c b/st.c @@ -649,13 +649,10 @@ selected(int x, int y) { if(sel.ey == y && sel.by == y) { bx = MIN(sel.bx, sel.ex); ex = MAX(sel.bx, sel.ex); + return BETWEEN(x, bx, ex); } - return ((sel.b.y < y && y < sel.e.y) - || (y == sel.e.y && x <= sel.e.x)) - || (y == sel.b.y && x >= sel.b.x - && (x <= sel.e.x || sel.b.y != sel.e.y)); switch(sel.type) { case SEL_REGULAR: return ((sel.b.y < y && y < sel.e.y)