Trying to apply correct styles when recalling history. See #32
authorMarijn van Vliet <w.m.vanvliet@student.utwente.nl>
Sun, 5 Jun 2011 18:51:17 +0000 (20:51 +0200)
committerMarijn van Vliet <w.m.vanvliet@student.utwente.nl>
Sun, 5 Jun 2011 18:51:17 +0000 (20:51 +0200)
libchimara/input.c

index e3f887b23052d38bf6657e38463a03ade49f7706..95a2aa4a4138c0ab5c57953aa14ed37bd7175809 100644 (file)
@@ -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
+}