X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=2612c955872b516a0ad76e2097b7f09d9a47bc78;hb=74cff67bd7746c2636ea7bc78a0b8af2f8c44838;hp=543c6150a6aeb5229d0995371166f367bd7a362d;hpb=403c57ebb5b3745ff93e49b87e526c49dc59a5b9;p=st.git diff --git a/st.c b/st.c index 543c615..2612c95 100644 --- a/st.c +++ b/st.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -445,6 +446,7 @@ selstart(int col, int row, int snap) selclear(); sel.mode = SEL_EMPTY; sel.type = SEL_REGULAR; + sel.alt = IS_SET(MODE_ALTSCREEN); sel.snap = snap; sel.oe.x = sel.ob.x = col; sel.oe.y = sel.ob.y = row; @@ -460,7 +462,7 @@ selextend(int col, int row, int type, int done) { int oldey, oldex, oldsby, oldsey, oldtype; - if (!sel.mode) + if (sel.mode == SEL_IDLE) return; if (done && sel.mode == SEL_EMPTY) { selclear(); @@ -473,7 +475,6 @@ selextend(int col, int row, int type, int done) oldsey = sel.ne.y; oldtype = sel.type; - sel.alt = IS_SET(MODE_ALTSCREEN); sel.oe.x = col; sel.oe.y = row; selnormalize(); @@ -739,7 +740,6 @@ sigchld(int a) exit(0); } - void stty(char **args) { @@ -761,7 +761,7 @@ stty(char **args) } *q = '\0'; if (system(cmd) != 0) - perror("Couldn't call stty"); + perror("Couldn't call stty"); } int @@ -1693,7 +1693,6 @@ csihandle(void) tputtab(csiescseq.arg[0]); break; case 'J': /* ED -- Clear screen */ - selclear(); switch (csiescseq.arg[0]) { case 0: /* below */ tclearregion(term.c.x, term.c.y, term.col-1, term.c.y);