all repos — st @ 22571ea4e8729efee6940b704666566b46e42e76

st (suckless terminal) config

selnormalize: make special case explicit

Special case is when regular selection spans multiple lines.
Otherwise, just sort sel.ob.x and sel.ob.y.
noname noname@inventati.org
commit

22571ea4e8729efee6940b704666566b46e42e76

parent

8751809aff596fc2030026713651c11b3743f88e

1 files changed, 4 insertions(+), 4 deletions(-)

jump to
M st.cst.c

@@ -685,12 +685,12 @@ void

selnormalize(void) { int i; - if(sel.ob.y == sel.oe.y || sel.type == SEL_RECTANGULAR) { - sel.nb.x = MIN(sel.ob.x, sel.oe.x); - sel.ne.x = MAX(sel.ob.x, sel.oe.x); - } else { + if(sel.type == SEL_REGULAR && sel.ob.y != sel.oe.y) { sel.nb.x = sel.ob.y < sel.oe.y ? sel.ob.x : sel.oe.x; sel.ne.x = sel.ob.y < sel.oe.y ? sel.oe.x : sel.ob.x; + } else { + sel.nb.x = MIN(sel.ob.x, sel.oe.x); + sel.ne.x = MAX(sel.ob.x, sel.oe.x); } sel.nb.y = MIN(sel.ob.y, sel.oe.y); sel.ne.y = MAX(sel.ob.y, sel.oe.y);