From 8d16d9ed5c0f3818d4eb62976e4b0cceaea86bba Mon Sep 17 00:00:00 2001 From: Ashish Kumar Yadav Date: Wed, 4 Aug 2021 23:38:37 +0530 Subject: [PATCH] Fixed bug in tresize; cleanup --- st/st.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/st/st.c b/st/st.c index 91ad8c3..c45bd9f 100644 --- a/st/st.c +++ b/st/st.c @@ -501,9 +501,10 @@ selextend(int col, int row, int type, int done) sel.type = type; selnormalize(); - if (oldey != sel.oe.y || oldex != sel.oe.x || oldtype != sel.type || sel.mode == SEL_EMPTY) + if (oldey != sel.oe.y || oldex != sel.oe.x || + oldtype != sel.type || sel.mode == SEL_EMPTY) { tsetdirt(MIN(sel.nb.y, oldsby), MAX(sel.ne.y, oldsey)); - + } sel.mode = done ? SEL_IDLE : SEL_READY; } @@ -538,7 +539,7 @@ selnormalize(void) int selected(int x, int y) { - if (sel.mode == SEL_EMPTY || sel.ob.x == -1 || + if (sel.ob.x == -1 || sel.mode == SEL_EMPTY || sel.alt != IS_SET(MODE_ALTSCREEN)) return 0; @@ -2773,7 +2774,7 @@ tresize(int col, int row) term.maxcol = MAX(col, pmaxcol); /* selection */ - if (sel.mode != SEL_EMPTY && sel.ob.x != -1 && + if (sel.ob.x != -1 && sel.mode != SEL_EMPTY && col != term.col && (sel.type == SEL_RECTANGULAR ? sel.ne.x >= col : sel.ne.y != sel.nb.y || sel.nb.x >= col || sel.ne.x >= col)) selremove();