Skip to content

Commit

Permalink
Ticket #256
Browse files Browse the repository at this point in the history
    fix: Alt+Backspace (kill word) behaviour in command line

Signed-off-by: Ilia Maslakov <[email protected]>
  • Loading branch information
egmontkob authored and Ilia Maslakov committed Oct 7, 2009
1 parent b009a7b commit 51771e0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/widget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1388,16 +1388,24 @@ backward_word (WInput *in)
const char *p = in->buffer + str_offset_to_pos (in->buffer, in->point);

while ((p != in->buffer) && (p[0] == '\0')) {
p--;
p--;
in->point--;
}

while ((p != in->buffer) && (str_isspace (p) || str_ispunct (p))) {
while (p != in->buffer) {
str_cprev_char (&p);
if (!str_isspace (p) && !str_ispunct (p)) {
str_cnext_char (&p);
break;
}
in->point--;
}
while ((p != in->buffer) && !str_isspace (p) && !str_ispunct (p)) {
while (p != in->buffer) {
str_cprev_char (&p);
if (str_isspace (p) || str_ispunct (p)) {
str_cnext_char (&p);
break;
}
in->point--;
}
}
Expand Down

0 comments on commit 51771e0

Please sign in to comment.