mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
Some fixies for optimization.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
51771e0092
commit
19493b9518
20
src/widget.c
20
src/widget.c
@ -1385,27 +1385,29 @@ forward_word (WInput * in)
|
||||
static void
|
||||
backward_word (WInput *in)
|
||||
{
|
||||
const char *p = in->buffer + str_offset_to_pos (in->buffer, in->point);
|
||||
const char *p;
|
||||
const char *p_tmp;
|
||||
|
||||
while ((p != in->buffer) && (p[0] == '\0')) {
|
||||
p--;
|
||||
in->point--;
|
||||
}
|
||||
for (
|
||||
p = in->buffer + str_offset_to_pos (in->buffer, in->point);
|
||||
(p != in->buffer) && (p[0] == '\0');
|
||||
p-- , in->point--
|
||||
);
|
||||
|
||||
while (p != in->buffer) {
|
||||
p_tmp = p;
|
||||
str_cprev_char (&p);
|
||||
if (!str_isspace (p) && !str_ispunct (p)) {
|
||||
str_cnext_char (&p);
|
||||
p = p_tmp;
|
||||
break;
|
||||
}
|
||||
in->point--;
|
||||
}
|
||||
while (p != in->buffer) {
|
||||
str_cprev_char (&p);
|
||||
if (str_isspace (p) || str_ispunct (p)) {
|
||||
str_cnext_char (&p);
|
||||
if (str_isspace (p) || str_ispunct (p))
|
||||
break;
|
||||
}
|
||||
|
||||
in->point--;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user