diff console/libgnt/gntentry.c @ 14973:f16e056f816d

[gaim-migrate @ 17752] Warmenhoved patch #1594991 (make del_prev_word work more like in emacs) from Trevor Caira. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 15 Nov 2006 19:38:49 +0000
parents d9d28bd79715
children 1c0772f7260b
line wrap: on
line diff
--- a/console/libgnt/gntentry.c	Wed Nov 15 19:12:09 2006 +0000
+++ b/console/libgnt/gntentry.c	Wed Nov 15 19:38:49 2006 +0000
@@ -338,6 +338,8 @@
 begin_word(const char *text, const char *begin)
 {
 	char ch;
+	while (text > begin && (isspace(*text) || !*text))
+		text--;
 	ch = *text;
 #define SAME(a,b)    ((isalpha(a) && isalpha(b)) || (isdigit(a) && isdigit(b)) || (isspace(a) && isspace(b)))
 	while (--text >= begin) {
@@ -563,7 +565,7 @@
 	gnt_bindable_class_register_action(bindable, "delete-end", del_to_end,
 				GNT_KEY_CTRL_K, NULL);
 	gnt_bindable_class_register_action(bindable, "delete-prev-word", del_prev_word,
-				NULL, NULL);
+				GNT_KEY_CTRL_W, NULL);
 #if 0
 	gnt_bindable_class_register_action(bindable, "delete-next-word", del_next_word,
 				NULL, 1, NULL);