--- a/src/gtkimhtml.c Sun May 23 05:52:24 2004 +0000 +++ b/src/gtkimhtml.c Sun May 23 06:28:29 2004 +0000 @@ -719,6 +719,9 @@ GtkTextIter iter; GtkIMHtmlOptions flags = plaintext ? 0 : GTK_IMHTML_NO_NEWLINE; + if (gtk_text_buffer_get_selection_bounds(imhtml->text_buffer, NULL, NULL)) + gtk_text_buffer_delete_selection(imhtml->text_buffer, TRUE, TRUE); + gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &iter, gtk_text_buffer_get_insert(imhtml->text_buffer)); if (!imhtml->wbfo && !plaintext) gtk_imhtml_close_tags(imhtml, &iter);