mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
fix doubleclick
This commit is contained in:
parent
276bf4edf1
commit
4999080d5b
1 changed files with 11 additions and 3 deletions
|
@ -304,6 +304,14 @@ threadmain(int argc, char *argv[])
|
|||
loop();
|
||||
}
|
||||
|
||||
int
|
||||
isexpand(Rune r)
|
||||
{
|
||||
return r=='_' || ('0' <= r && r <= '9')
|
||||
|| ('a' <= r && r <= 'z')
|
||||
|| ('A' <= r && r <= 'Z');
|
||||
}
|
||||
|
||||
void
|
||||
hangupnote(void *a, char *msg)
|
||||
{
|
||||
|
@ -992,7 +1000,7 @@ bswidth(Rune c, uint start, int eatnl)
|
|||
break;
|
||||
}
|
||||
if(c == 0x17){
|
||||
eq = isalnum(r);
|
||||
eq = isexpand(r);
|
||||
if(eq && skipping) /* found one; stop skipping */
|
||||
skipping = 0;
|
||||
else if(!eq && !skipping)
|
||||
|
@ -1600,10 +1608,10 @@ doubleclick(uint *q0, uint *q1)
|
|||
}
|
||||
}
|
||||
/* try filling out word to right */
|
||||
while(*q1<t.nr && isalnum(t.r[*q1]))
|
||||
while(*q1<t.nr && isexpand(t.r[*q1]))
|
||||
(*q1)++;
|
||||
/* try filling out word to left */
|
||||
while(*q0>0 && isalnum(t.r[*q0-1]))
|
||||
while(*q0>0 && isexpand(t.r[*q0-1]))
|
||||
(*q0)--;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue