Fix selection: selscroll

master
Jakub Leszczak 5 years ago committed by Hiltjo Posthuma
parent 9c30066e73
commit 045a0fab4f

26
st.c

@ -1106,29 +1106,19 @@ selscroll(int orig, int n)
if (sel.ob.x == -1) if (sel.ob.x == -1)
return; return;
if (BETWEEN(sel.ob.y, orig, term.bot) || BETWEEN(sel.oe.y, orig, term.bot)) { if (BETWEEN(sel.nb.y, orig, term.bot) != BETWEEN(sel.ne.y, orig, term.bot)) {
if ((sel.ob.y += n) > term.bot || (sel.oe.y += n) < term.top) { selclear();
} else if (BETWEEN(sel.nb.y, orig, term.bot)) {
sel.ob.y += n;
sel.oe.y += n;
if (sel.ob.y < term.top || sel.ob.y > term.bot ||
sel.oe.y < term.top || sel.oe.y > term.bot) {
selclear(); selclear();
return;
}
if (sel.type == SEL_RECTANGULAR) {
if (sel.ob.y < term.top)
sel.ob.y = term.top;
if (sel.oe.y > term.bot)
sel.oe.y = term.bot;
} else { } else {
if (sel.ob.y < term.top) {
sel.ob.y = term.top;
sel.ob.x = 0;
}
if (sel.oe.y > term.bot) {
sel.oe.y = term.bot;
sel.oe.x = term.col;
}
}
selnormalize(); selnormalize();
} }
} }
}
void void
tnewline(int first_col) tnewline(int first_col)

Loading…
Cancel
Save