2000-04-12 Timur Bakeyev <mc@bat.ru>
* widget.c ([forward|backward]_word): Changed one more time - now it skips alpnums and THEN spaces+punct. That gives almost the same re- sults, but twice quicker. Hope, this will be accepted.
Этот коммит содержится в:
родитель
8e9fee530c
Коммит
592e809966
@ -1,3 +1,9 @@
|
||||
2000-04-12 Timur Bakeyev <mc@bat.ru>
|
||||
|
||||
* widget.c ([forward|backward]_word): Changed one more time - now it
|
||||
skips alpnums and THEN spaces+punct. That gives almost the same re-
|
||||
sults, but twice quicker. Hope, this will be accepted.
|
||||
|
||||
2000-04-06 Timur Bakeyev <mc@bat.ru>
|
||||
|
||||
* widget.c ([forward|backward]_word): Changed logic of moving - now,
|
||||
|
24
src/widget.c
24
src/widget.c
@ -1288,14 +1288,10 @@ forward_word (WInput *in)
|
||||
unsigned char *p = in->buffer+in->point;
|
||||
|
||||
/* We really want to delete either words or separators */
|
||||
if(isspace (*p) || ispunct (*p)) {
|
||||
while (*p && (isspace (*p) || ispunct (*p)))
|
||||
p++;
|
||||
}
|
||||
else if(isalnum (*p)) {
|
||||
while (*p && isalnum (*p))
|
||||
p++;
|
||||
}
|
||||
while (*p && isalnum (*p))
|
||||
p++;
|
||||
while (*p && (isspace (*p) || ispunct (*p)))
|
||||
p++;
|
||||
in->point = p - in->buffer;
|
||||
}
|
||||
|
||||
@ -1305,14 +1301,10 @@ backward_word (WInput *in)
|
||||
unsigned char *p = in->buffer+in->point;
|
||||
|
||||
/* We really want to delete either words or separators */
|
||||
if(p-1 > in->buffer-1 && (isspace (*(p-1)) || ispunct (*(p-1)))) {
|
||||
while (p-1 > in->buffer-1 && (isspace (*(p-1)) || ispunct (*(p-1))))
|
||||
p--;
|
||||
}
|
||||
else if(p-1 > in->buffer-1 && isalnum (*(p-1))) {
|
||||
while (p-1 > in->buffer-1 && isalnum (*(p-1)))
|
||||
p--;
|
||||
}
|
||||
while (p-1 > in->buffer-1 && isalnum (*(p-1)))
|
||||
p--;
|
||||
while (p-1 > in->buffer-1 && (isspace (*(p-1)) || ispunct (*(p-1))))
|
||||
p--;
|
||||
in->point = p - in->buffer;
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user