add chord fix from plan 9
This commit is contained in:
parent
6cb755b60b
commit
8b9a1d4cfe
2 changed files with 10 additions and 7 deletions
|
|
@ -1009,8 +1009,8 @@ textselect(Text *t)
|
||||||
while(mouse->buttons){
|
while(mouse->buttons){
|
||||||
mouse->msec = 0;
|
mouse->msec = 0;
|
||||||
b = mouse->buttons;
|
b = mouse->buttons;
|
||||||
if(b & 6){
|
if((b&1) && (b&6)){
|
||||||
if(state==0 && op==0 && t->what==Body){
|
if(state==0 && t->what==Body){
|
||||||
seq++;
|
seq++;
|
||||||
filemark(t->w->body.file);
|
filemark(t->w->body.file);
|
||||||
}
|
}
|
||||||
|
|
@ -1019,18 +1019,18 @@ textselect(Text *t)
|
||||||
winundo(t->w, TRUE);
|
winundo(t->w, TRUE);
|
||||||
textsetselect(t, q0, t->q0);
|
textsetselect(t, q0, t->q0);
|
||||||
state = 0;
|
state = 0;
|
||||||
}else if(state != 1 && op != -1){
|
}else if(state != 1){
|
||||||
cut(t, t, nil, TRUE, TRUE, nil, 0);
|
cut(t, t, nil, TRUE, TRUE, nil, 0);
|
||||||
op = state = 1;
|
state = 1;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(state==1 && t->what==Body){
|
if(state==1 && t->what==Body){
|
||||||
winundo(t->w, TRUE);
|
winundo(t->w, TRUE);
|
||||||
textsetselect(t, q0, t->q1);
|
textsetselect(t, q0, t->q1);
|
||||||
state = 0;
|
state = 0;
|
||||||
}else if(state != -1 && op != 1){
|
}else if(state != -1){
|
||||||
paste(t, t, nil, TRUE, FALSE, nil, 0);
|
paste(t, t, nil, TRUE, FALSE, nil, 0);
|
||||||
op = state = -1;
|
state = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
textscrdraw(t);
|
textscrdraw(t);
|
||||||
|
|
|
||||||
|
|
@ -115,9 +115,12 @@ wintaglines(Window *w, Rectangle r)
|
||||||
|
|
||||||
/* if tag ends with \n, include empty line at end for typing */
|
/* if tag ends with \n, include empty line at end for typing */
|
||||||
n = w->tag.fr.nlines;
|
n = w->tag.fr.nlines;
|
||||||
|
if(w->tag.file->b.nc > 0)
|
||||||
bufread(&w->tag.file->b, w->tag.file->b.nc-1, &rune, 1);
|
bufread(&w->tag.file->b, w->tag.file->b.nc-1, &rune, 1);
|
||||||
if(rune == '\n')
|
if(rune == '\n')
|
||||||
n++;
|
n++;
|
||||||
|
if(n == 0)
|
||||||
|
n = 1;
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue