From: rodin Date: Tue, 30 Mar 2010 11:53:14 +0000 (+0000) Subject: Fixed hitting enter key mid sentence X-Git-Tag: v0.9~236 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=d650d232de0f03f7d6be4a9b50d1bb3c825d24fb;p=projects%2Fchimara%2Fchimara.git Fixed hitting enter key mid sentence --- diff --git a/libchimara/input.c b/libchimara/input.c index 96b6353..df872da 100644 --- a/libchimara/input.c +++ b/libchimara/input.c @@ -514,6 +514,15 @@ on_line_input_key_press_event(GtkWidget *widget, GdkEventKey *event, winid_t win return TRUE; } + /* Handle the enter key, which could occur in the middle of the sentence. */ + else if(event->keyval == GDK_Return || event->keyval == GDK_KP_Enter) { + GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(win->widget)); + GtkTextIter end_iter; + gtk_text_buffer_get_end_iter(buffer, &end_iter); + gtk_text_buffer_place_cursor(buffer, &end_iter); + return FALSE; + } + return FALSE; /* If this is a text grid window, then redirect the key press to the line input GtkEntry */