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
|
static void
|
||||||
backward_word (WInput *in)
|
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')) {
|
for (
|
||||||
p--;
|
p = in->buffer + str_offset_to_pos (in->buffer, in->point);
|
||||||
in->point--;
|
(p != in->buffer) && (p[0] == '\0');
|
||||||
}
|
p-- , in->point--
|
||||||
|
);
|
||||||
|
|
||||||
while (p != in->buffer) {
|
while (p != in->buffer) {
|
||||||
|
p_tmp = p;
|
||||||
str_cprev_char (&p);
|
str_cprev_char (&p);
|
||||||
if (!str_isspace (p) && !str_ispunct (p)) {
|
if (!str_isspace (p) && !str_ispunct (p)) {
|
||||||
str_cnext_char (&p);
|
p = p_tmp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
in->point--;
|
in->point--;
|
||||||
}
|
}
|
||||||
while (p != in->buffer) {
|
while (p != in->buffer) {
|
||||||
str_cprev_char (&p);
|
str_cprev_char (&p);
|
||||||
if (str_isspace (p) || str_ispunct (p)) {
|
if (str_isspace (p) || str_ispunct (p))
|
||||||
str_cnext_char (&p);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
in->point--;
|
in->point--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user