# HG changeset patch # User Richard Nelson # Date 1196221878 0 # Node ID 65f2a29617a2512cdfa2e6edd15a9d7171b21b09 # Parent a312781708e8b6e72d4286e2673ff47e615dcaf1 Fix cursor-next-word behaviour, noticed by jtb. Change dump-screen binding to M-D (and have it use a file req dialog) to give delete-next-word a say in things. diff -r a312781708e8 -r 65f2a29617a2 finch/libgnt/gntentry.c --- a/finch/libgnt/gntentry.c Wed Nov 28 02:54:31 2007 +0000 +++ b/finch/libgnt/gntentry.c Wed Nov 28 03:51:18 2007 +0000 @@ -575,15 +575,16 @@ next_begin_word(const char *text, const char *end) { gunichar ch = 0; + + while (text && text < end && g_unichar_isspace(g_utf8_get_char(text))) + text = g_utf8_find_next_char(text, end); + ch = g_utf8_get_char(text); while ((text = g_utf8_find_next_char(text, end)) != NULL && text <= end) { gunichar cur = g_utf8_get_char(text); if (!SAME(ch, cur)) break; } - - while (text && text < end && g_unichar_isspace(g_utf8_get_char(text))) - text = g_utf8_find_next_char(text, end); return (text ? text : end); } diff -r a312781708e8 -r 65f2a29617a2 finch/libgnt/gntwm.c --- a/finch/libgnt/gntwm.c Wed Nov 28 02:54:31 2007 +0000 +++ b/finch/libgnt/gntwm.c Wed Nov 28 03:51:18 2007 +0000 @@ -28,6 +28,7 @@ #include "config.h" #include +#include #include #include #include @@ -41,6 +42,7 @@ #include "gntbox.h" #include "gntbutton.h" #include "gntentry.h" +#include "gntfilesel.h" #include "gntlabel.h" #include "gntmenu.h" #include "gnttextview.h" @@ -663,12 +665,12 @@ return TRUE; } -static gboolean -dump_screen(GntBindable *bindable, GList *null) +static void +dump_file_save(GntFileSel *fs, const char *path, const char *f, gpointer n) { + FILE *file; int x, y; chtype old = 0, now = 0; - FILE *file = fopen("dump.html", "w"); struct { char ascii; char *unicode; @@ -690,6 +692,11 @@ {'\0', NULL} }; + + if ((file = g_fopen(path, "w+")) == NULL) { + return; + } + fprintf(file, "\n \n\n\n"); fprintf(file, "
");
 	for (y = 0; y < getmaxy(stdscr); y++) {
@@ -796,6 +803,24 @@
 	}
 	fprintf(file, "
\n"); fclose(file); + gnt_widget_destroy(GNT_WIDGET(fs)); +} + +static void +dump_file_cancel(GntWidget *w, GntFileSel *fs) +{ + gnt_widget_destroy(GNT_WIDGET(fs)); +} + +static gboolean +dump_screen(GntBindable *b, GList *null) +{ + GntWidget *window = gnt_file_sel_new(); + GntFileSel *sel = GNT_FILE_SEL(window); + gnt_file_sel_set_suggested_filename(sel, "dump.html"); + g_signal_connect(G_OBJECT(sel), "file_selected", G_CALLBACK(dump_file_save), NULL); + g_signal_connect(G_OBJECT(sel->cancel), "activate", G_CALLBACK(dump_file_cancel), sel); + gnt_widget_show(window); return TRUE; } @@ -1366,7 +1391,7 @@ gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-list", window_list, "\033" "w", NULL); gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "dump-screen", dump_screen, - "\033" "d", NULL); + "\033" "D", NULL); gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "shift-left", shift_left, "\033" ",", NULL); gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "shift-right", shift_right,