X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=st.c;h=78d8a01876e8ab81c9bf2845904874cc388e3c76;hb=cf890e5bf06a65a35fe195aa1ef8ae3e1eb55f51;hp=baab589080d48cb64df922c72113fbcb83aefd15;hpb=5e917ab2874de556de12ce43e9a97300c9c722a2;p=st.git diff --git a/st.c b/st.c index baab589..78d8a01 100644 --- a/st.c +++ b/st.c @@ -765,7 +765,7 @@ selsnap(int mode, int *x, int *y, int direction) { void getbuttoninfo(XEvent *e) { int type; - uint state = e->xbutton.state &~Button1Mask; + uint state = e->xbutton.state & ~(Button1Mask | forceselmod); sel.alt = IS_SET(MODE_ALTSCREEN); @@ -858,7 +858,7 @@ bpress(XEvent *e) { struct timeval now; Mousekey *mk; - if(IS_SET(MODE_MOUSE)) { + if(IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) { mousereport(e); return; } @@ -1090,7 +1090,7 @@ xsetsel(char *str) { void brelease(XEvent *e) { - if(IS_SET(MODE_MOUSE)) { + if(IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) { mousereport(e); return; } @@ -1113,7 +1113,7 @@ void bmotion(XEvent *e) { int oldey, oldex, oldsby, oldsey; - if(IS_SET(MODE_MOUSE)) { + if(IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) { mousereport(e); return; } @@ -2335,19 +2335,19 @@ tcontrolcode(uchar ascii) { switch(ascii) { case '\t': /* HT */ tputtab(1); - break; + return; case '\b': /* BS */ tmoveto(term.c.x-1, term.c.y); - break; + return; case '\r': /* CR */ tmoveto(0, term.c.y); - break; + return; case '\f': /* LF */ case '\v': /* VT */ case '\n': /* LF */ /* go to first col if the mode is set */ tnewline(IS_SET(MODE_CRLF)); - break; + return; case '\a': /* BEL */ if(term.esc & ESC_STR_END) { /* backwards compatibility to xterm */ @@ -2366,10 +2366,10 @@ tcontrolcode(uchar ascii) { return; case '\016': /* SO */ term.charset = 0; - break; + return; case '\017': /* SI */ term.charset = 1; - break; + return; case '\032': /* SUB */ tsetchar(question, &term.c.attr, term.c.x, term.c.y); case '\030': /* CAN */ @@ -2380,6 +2380,7 @@ tcontrolcode(uchar ascii) { case '\021': /* XON (IGNORED) */ case '\023': /* XOFF (IGNORED) */ case 0177: /* DEL (IGNORED) */ + return; case 0x84: /* TODO: IND */ case 0x85: /* TODO: NEL */ case 0x88: /* TODO: HTS */ @@ -2396,6 +2397,7 @@ tcontrolcode(uchar ascii) { case 0x9f: /* TODO: APC */ break; } + /* only CAN, SUB, \a and C1 chars interrupt a sequence */ term.esc &= ~(ESC_STR_END|ESC_STR); return; } @@ -3437,6 +3439,7 @@ void redraw(int timeout) { struct timespec tv = {0, timeout * 1000}; + tfulldirt(); draw(); if(timeout > 0) {