all repos — st @ 440a19a662cec7aaec07cec47e7743f22f0e5f26

st (suckless terminal) config

Getbuttoninfo is always used the same and just a helper function. Shrinking it

a bit. Thanks nsz!
Christoph Lohmann 20h@r-36.net
commit

440a19a662cec7aaec07cec47e7743f22f0e5f26

parent

6312f76ca47f94119a7740dd36f7dd6ce037e907

1 files changed, 5 insertions(+), 8 deletions(-)

jump to
M st.cst.c

@@ -621,12 +621,9 @@ && (x <= sel.e.x || sel.b.y != sel.e.y));

} void -getbuttoninfo(XEvent *e, int *b, int *x, int *y) { - if(b) - *b = e->xbutton.button; - - *x = x2col(e->xbutton.x); - *y = y2row(e->xbutton.y); +getbuttoninfo(XEvent *e) { + sel.ex = x2col(e->xbutton.x); + sel.ey = y2row(e->xbutton.y); sel.b.x = sel.by < sel.ey ? sel.bx : sel.ex; sel.b.y = MIN(sel.by, sel.ey);

@@ -824,7 +821,7 @@ if(e->xbutton.button == Button2) {

selpaste(NULL); } else if(e->xbutton.button == Button1) { sel.mode = 0; - getbuttoninfo(e, NULL, &sel.ex, &sel.ey); + getbuttoninfo(e); term.dirty[sel.ey] = 1; if(sel.bx == sel.ex && sel.by == sel.ey) { sel.bx = -1;

@@ -873,7 +870,7 @@

if(sel.mode) { oldey = sel.ey; oldex = sel.ex; - getbuttoninfo(e, NULL, &sel.ex, &sel.ey); + getbuttoninfo(e); if(oldey != sel.ey || oldex != sel.ex) { starty = MIN(oldey, sel.ey);