2000-04-06 Timur Bakeyev <mc@bat.ru>
* widget.c ([forward|backward]_word): Changed logic of moving - now, it skips only spaces+punct OR alnum. Reason to have it deleting lines like "lynx http://www.gnome.org", where "lynx http:" part was erased in one operation. That's nasty, IMHO. Made this a separate commit, so, if it seriously breaks compatability it's easy to revert it. Still hope, nobody'll do that.
Этот коммит содержится в:
родитель
3bfe8a0b3c
Коммит
7ea86f14c0
@ -1,3 +1,12 @@
|
||||
2000-04-06 Timur Bakeyev <mc@bat.ru>
|
||||
|
||||
* widget.c ([forward|backward]_word): Changed logic of moving - now,
|
||||
it skips only spaces+punct OR alnum. Reason to do it so - deleting lines
|
||||
like "lynx http://www.gnome.org", where "lynx http:" part was erased
|
||||
in one operation. That's nasty, IMHO. Made this a separate commit, so,
|
||||
if it seriously breaks compatability it's easy to revert it. Still hope,
|
||||
nobody'll do that.
|
||||
|
||||
2000-04-06 Timur Bakeyev <mc@bat.ru>
|
||||
|
||||
* file.c, widget.[ch]: Fixed long existing problems with filenames
|
||||
|
28
src/widget.c
28
src/widget.c
@ -1286,11 +1286,16 @@ static void
|
||||
forward_word (WInput *in)
|
||||
{
|
||||
unsigned char *p = in->buffer+in->point;
|
||||
|
||||
while (*p && (isspace (*p) || ispunct (*p)))
|
||||
p++;
|
||||
while (*p && isalnum (*p))
|
||||
p++;
|
||||
|
||||
/* 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++;
|
||||
}
|
||||
in->point = p - in->buffer;
|
||||
}
|
||||
|
||||
@ -1299,10 +1304,15 @@ backward_word (WInput *in)
|
||||
{
|
||||
unsigned char *p = in->buffer+in->point;
|
||||
|
||||
while (p-1 > in->buffer-1 && (isspace (*(p-1)) || ispunct (*(p-1))))
|
||||
p--;
|
||||
while (p-1 > in->buffer-1 && isalnum (*(p-1)))
|
||||
p--;
|
||||
/* 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--;
|
||||
}
|
||||
in->point = p - in->buffer;
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user