From: <sa...@us...> - 2006-12-07 07:05:05
|
Revision: 17911 http://svn.sourceforge.net/gaim/?rev=17911&view=rev Author: sadrul Date: 2006-12-06 23:01:32 -0800 (Wed, 06 Dec 2006) Log Message: ----------- 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. Modified Paths: -------------- trunk/console/libgnt/gntentry.c Modified: trunk/console/libgnt/gntentry.c =================================================================== --- trunk/console/libgnt/gntentry.c 2006-12-07 06:43:37 UTC (rev 17910) +++ trunk/console/libgnt/gntentry.c 2006-12-07 07:01:32 UTC (rev 17911) @@ -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); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |