tadd rog's chording fix. - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit aba09191af8012bc7d6a1b998ac937875f728d0c
 (DIR) parent 9fdc52c625d7d82939d15db498352e7b5a9dede0
 (HTM) Author: rsc <devnull@localhost>
       Date:   Fri, 16 Apr 2004 05:11:34 +0000
       
       add rog's chording fix.
       
       Diffstat:
         M src/cmd/acme/text.c                 |      14 +++++++-------
       
       1 file changed, 7 insertions(+), 7 deletions(-)
       ---
 (DIR) diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c
       t@@ -862,7 +862,7 @@ textselect(Text *t)
        {
                uint q0, q1;
                int b, x, y;
       -        int state;
       +        int state, op;
        
                selecttext = t;
                /*
       t@@ -918,12 +918,12 @@ textselect(Text *t)
                        clicktext = nil;
                textsetselect(t, q0, q1);
                flushimage(display, 1);
       -        state = 0;        /* undo when possible; +1 for cut, -1 for paste */
       +        state = op = 0;        /* undo when possible; +1 for cut, -1 for paste */
                while(mouse->buttons){
                        mouse->msec = 0;
                        b = mouse->buttons;
                        if(b & 6){
       -                        if(state==0 && t->what==Body){
       +                        if(state==0 && op==0 && t->what==Body){
                                        seq++;
                                        filemark(t->w->body.file);
                                }
       t@@ -932,18 +932,18 @@ textselect(Text *t)
                                                winundo(t->w, TRUE);
                                                textsetselect(t, q0, t->q0);
                                                state = 0;
       -                                }else if(state != 1){
       +                                }else if(state != 1 && op != -1){
                                                cut(t, t, nil, TRUE, TRUE, nil, 0);
       -                                        state = 1;
       +                                        op = state = 1;
                                        }
                                }else{
                                        if(state==1 && t->what==Body){
                                                winundo(t->w, TRUE);
                                                textsetselect(t, q0, t->q1);
                                                state = 0;
       -                                }else if(state != -1){
       +                                }else if(state != -1 && op != 1){
                                                paste(t, t, nil, TRUE, FALSE, nil, 0);
       -                                        state = -1;
       +                                        op = state = -1;
                                        }
                                }
                                textscrdraw(t);