From: Marijn van Vliet Date: Sun, 5 Jun 2011 18:51:17 +0000 (+0200) Subject: Trying to apply correct styles when recalling history. See #32 X-Git-Tag: v0.9~82 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=f66c68ab2bee571ba58e4b05b9b190f2e46dcb6e;p=projects%2Fchimara%2Fchimara.git Trying to apply correct styles when recalling history. See #32 --- diff --git a/libchimara/input.c b/libchimara/input.c index e3f887b..95a2aa4 100644 --- a/libchimara/input.c +++ b/libchimara/input.c @@ -194,7 +194,9 @@ text_buffer_request_line_event_common(winid_t win, glui32 maxlen, gboolean inser /* Apply the correct style to the input prompt */ GtkTextIter input_iter; gtk_text_buffer_get_iter_at_mark(buffer, &input_iter, input_position); + gtk_text_buffer_apply_tag_by_name(buffer, "default", &input_iter, &end_iter); gtk_text_buffer_apply_tag_by_name(buffer, "input", &input_iter, &end_iter); + gtk_text_buffer_apply_tag_by_name(buffer, "glk-input", &input_iter, &end_iter); gtk_text_view_set_editable(GTK_TEXT_VIEW(win->widget), TRUE); @@ -521,7 +523,8 @@ on_line_input_key_press_event(GtkWidget *widget, GdkEventKey *event, winid_t win gtk_text_buffer_get_end_iter(buffer, &end); g_signal_handler_block(buffer, win->insert_text_handler); - gtk_text_buffer_insert_with_tags_by_name(buffer, &end, win->history_pos->data, -1, "default", "input", NULL); + gtk_text_buffer_insert_with_tags_by_name(buffer, &end, win->history_pos->data, -1, "default", "input", "glk-input", NULL); + g_signal_handler_unblock(buffer, win->insert_text_handler); return TRUE; } @@ -1166,4 +1169,4 @@ glk_set_terminators_line_event(winid_t win, glui32 *keycodes, glui32 count) else WARNING_S("Ignoring invalid line terminator", gdk_keyval_name(key)); } -} \ No newline at end of file +}