Fix off-by-one misbehavior of Ctrl-Left and Alt-Backspace.
diff -Naurdp mc-4.6.1.orig/src/widget.c mc-4.6.1/src/widget.c
old
|
new
|
backward_word (WInput *in) |
1385 | 1385 | memset (&mbs, 0, sizeof (mbs)); |
1386 | 1386 | while (in->point > 0) { |
1387 | 1387 | wchar_t c; |
1388 | | char *p = in->buffer + charpos(in,in->point); |
| 1388 | char *p = in->buffer + charpos(in,in->point-1); |
1389 | 1389 | size_t res = mbrtowc(&c, p, strlen(p), &mbs); |
1390 | 1390 | if (*p && (res <= 0 || !(iswspace (c) || iswpunct (c)))) |
1391 | 1391 | break; |
… |
… |
backward_word (WInput *in) |
1396 | 1396 | |
1397 | 1397 | while (in->point > 0) { |
1398 | 1398 | wchar_t c; |
1399 | | char *p = in->buffer + charpos(in,in->point); |
| 1399 | char *p = in->buffer + charpos(in,in->point-1); |
1400 | 1400 | size_t res = mbrtowc(&c, p, strlen(p), &mbs); |
1401 | 1401 | if (*p && (res <= 0 || !iswalnum (c))) |
1402 | 1402 | break; |