add rog's chording fix.

This commit is contained in:
rsc 2004-04-16 05:11:34 +00:00
parent 9fdc52c625
commit aba09191af

View file

@ -862,7 +862,7 @@ textselect(Text *t)
{
uint q0, q1;
int b, x, y;
int state;
int state, op;
selecttext = 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);
}
@ -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);