X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=src%2Fstrio.c;h=921b75cc771f0331828220061dbfc9030726fcd1;hb=91214934fbcdfd363202a65c142194506604ff7b;hp=4517b38dec72e9122f08969bc766c313e7e9f093;hpb=5ae8c90ba8cbfeaddef0c2ae69cc0745b64cd379;p=projects%2Fchimara%2Fchimara.git diff --git a/src/strio.c b/src/strio.c index 4517b38..921b75c 100644 --- a/src/strio.c +++ b/src/strio.c @@ -17,6 +17,12 @@ static void write_utf8_to_grid(winid_t win, gchar *s) { + if(win->input_request_type == INPUT_REQUEST_LINE || win->input_request_type == INPUT_REQUEST_LINE_UNICODE) + { + ILLEGAL("Tried to print to a text grid window with line input pending."); + return; + } + /* Number of characters to insert */ glong length = g_utf8_strlen(s, -1); glong chars_left = length; @@ -59,13 +65,19 @@ write_utf8_to_grid(winid_t win, gchar *s) static void write_utf8_to_window(winid_t win, gchar *s) { + if(win->input_request_type == INPUT_REQUEST_LINE || win->input_request_type == INPUT_REQUEST_LINE_UNICODE) + { + ILLEGAL("Tried to print to a text buffer window with line input pending."); + return; + } + gdk_threads_enter(); GtkTextBuffer *buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(win->widget) ); GtkTextIter iter; gtk_text_buffer_get_end_iter(buffer, &iter); - gtk_text_buffer_insert(buffer, &iter, s, -1); + gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, s, -1, win->window_stream->style, NULL); gdk_threads_leave(); }