# HG changeset patch # User Sadrul Habib Chowdhury # Date 1165474892 0 # Node ID 1bd757119ca72df4a40604d9647d60b70ca1f90b # Parent ed14c190a8683a65e642aa4f3ee501b3f5840cb3 [gaim-migrate @ 17911] Add action delete-next-word with a-d as the default binding. Unfortunately, this is also the default binding for the wm to dump an html screenshot. So you will need to unbind that first to make this work. committer: Tailor Script diff -r ed14c190a868 -r 1bd757119ca7 console/libgnt/gntentry.c --- a/console/libgnt/gntentry.c Thu Dec 07 06:43:37 2006 +0000 +++ b/console/libgnt/gntentry.c Thu Dec 07 07:01:32 2006 +0000 @@ -428,14 +428,16 @@ } static gboolean -move_forward_word(GntBindable *bind, GList *list) +delete_forward_word(GntBindable *bind, GList *list) { GntEntry *entry = GNT_ENTRY(bind); GntWidget *widget = GNT_WIDGET(bind); - entry->cursor = (char *)next_begin_word(entry->cursor, entry->end); - while (gnt_util_onscreen_width(entry->scroll, entry->cursor) >= widget->priv.width) { - entry->scroll = g_utf8_find_next_char(entry->scroll, NULL); - } + char *iter = (char *)next_begin_word(entry->cursor, entry->end); + int len = entry->end - iter + 1; + memmove(entry->cursor, iter, len); + len = iter - entry->cursor; + entry->end -= len; + memset(entry->end, '\0', len); entry_redraw(widget); return TRUE; } @@ -627,7 +629,7 @@ gnt_bindable_register_binding(bindable, "cursor-next", GNT_KEY_CTRL_F, NULL); gnt_bindable_class_register_action(bindable, "cursor-next-word", move_forward_word, "\033" "f", NULL); - gnt_bindable_class_register_action(bindable, "cursor-next-word", delete_forward_word, + gnt_bindable_class_register_action(bindable, "delete-next-word", delete_forward_word, "\033" "d", NULL); gnt_bindable_class_register_action(bindable, "suggest-show", suggest_show, "\t", NULL);