comparison 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
comparison
equal deleted inserted replaced
14972:cfb736e4a2c4 14973:f16e056f816d
336 336
337 static const char * 337 static const char *
338 begin_word(const char *text, const char *begin) 338 begin_word(const char *text, const char *begin)
339 { 339 {
340 char ch; 340 char ch;
341 while (text > begin && (isspace(*text) || !*text))
342 text--;
341 ch = *text; 343 ch = *text;
342 #define SAME(a,b) ((isalpha(a) && isalpha(b)) || (isdigit(a) && isdigit(b)) || (isspace(a) && isspace(b))) 344 #define SAME(a,b) ((isalpha(a) && isalpha(b)) || (isdigit(a) && isdigit(b)) || (isspace(a) && isspace(b)))
343 while (--text >= begin) { 345 while (--text >= begin) {
344 if (!SAME(ch, *text)) 346 if (!SAME(ch, *text))
345 break; 347 break;
561 gnt_bindable_class_register_action(bindable, "delete-start", del_to_home, 563 gnt_bindable_class_register_action(bindable, "delete-start", del_to_home,
562 GNT_KEY_CTRL_U, NULL); 564 GNT_KEY_CTRL_U, NULL);
563 gnt_bindable_class_register_action(bindable, "delete-end", del_to_end, 565 gnt_bindable_class_register_action(bindable, "delete-end", del_to_end,
564 GNT_KEY_CTRL_K, NULL); 566 GNT_KEY_CTRL_K, NULL);
565 gnt_bindable_class_register_action(bindable, "delete-prev-word", del_prev_word, 567 gnt_bindable_class_register_action(bindable, "delete-prev-word", del_prev_word,
566 NULL, NULL); 568 GNT_KEY_CTRL_W, NULL);
567 #if 0 569 #if 0
568 gnt_bindable_class_register_action(bindable, "delete-next-word", del_next_word, 570 gnt_bindable_class_register_action(bindable, "delete-next-word", del_next_word,
569 NULL, 1, NULL); 571 NULL, 1, NULL);
570 #endif 572 #endif
571 gnt_bindable_class_register_action(bindable, "cursor-prev-word", move_back_word, 573 gnt_bindable_class_register_action(bindable, "cursor-prev-word", move_back_word,