X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=st.c;h=6dc20fbfddaf933c9b4686c356f3d8b712553a07;hb=55087ec2c7e78e4349259c4547aa58fa705fa915;hp=db21901c158e063092b66bb7405a8638605c5987;hpb=0df350cd0b64f83fbc2324bb2a1bc04b51e657e0;p=st.git diff --git a/st.c b/st.c index db21901..6dc20fb 100644 --- a/st.c +++ b/st.c @@ -621,12 +621,9 @@ selected(int x, int 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 @@ brelease(XEvent *e) { 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 @@ bmotion(XEvent *e) { 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); @@ -2082,7 +2079,7 @@ tputc(char *c, int len) { } } /* - * All characters which forms part of a sequence are not + * All characters which form part of a sequence are not * printed */ return;