[hackers] [st] End a sequence only on CAN, SUB,  and C1s. || Colona

From: <git_AT_suckless.org>
Date: Fri, 09 May 2014 10:37:33 +0200

commit e31829f659a818e438bf2fe45708abb2983f8765
Author: Colona <colona_AT_ycc.fr>
Date: Fri May 9 10:23:53 2014 +0200

    End a sequence only on CAN, SUB,  and C1s.

diff --git a/st.c b/st.c
index baab589..fd872c1 100644
--- a/st.c
+++ b/st.c
_AT_@ -2335,19 +2335,19 @@ tcontrolcode(uchar ascii) {
         switch(ascii) {
         case ' ': /* HT */
                 tputtab(1);
- break;
+ return;
         case '': /* BS */
                 tmoveto(term.c.x-1, term.c.y);
- break;
+ return;
         case ' ': /* CR */
                 tmoveto(0, term.c.y);
- break;
+ return;
         case ' ': /* LF */
         case ' ': /* VT */
         case '
': /* LF */
                 /* go to first col if the mode is set */
                 tnewline(IS_SET(MODE_CRLF));
- break;
+ return;
         case '': /* BEL */
                 if(term.esc & ESC_STR_END) {
                         /* backwards compatibility to xterm */
_AT_@ -2366,10 +2366,10 @@ tcontrolcode(uchar ascii) {
                 return;
         case '': /* SO */
                 term.charset = 0;
- break;
+ return;
         case '': /* SI */
                 term.charset = 1;
- break;
+ return;
         case '': /* SUB */
                 tsetchar(question, &term.c.attr, term.c.x, term.c.y);
         case '': /* CAN */
_AT_@ -2380,6 +2380,7 @@ tcontrolcode(uchar ascii) {
         case '': /* XON (IGNORED) */
         case '': /* XOFF (IGNORED) */
         case 0177: /* DEL (IGNORED) */
+ return;
         case 0x84: /* TODO: IND */
         case 0x85: /* TODO: NEL */
         case 0x88: /* TODO: HTS */
_AT_@ -2396,6 +2397,7 @@ tcontrolcode(uchar ascii) {
         case 0x9f: /* TODO: APC */
                 break;
         }
+ /* only CAN, SUB,  and C1 chars interrupt a sequence */
         term.esc &= ~(ESC_STR_END|ESC_STR);
         return;
 }
Received on Fri May 09 2014 - 10:37:33 CEST

This archive was generated by hypermail 2.3.0 : Fri May 09 2014 - 10:48:12 CEST