diff src/gtkimhtml.c @ 9599:a1029432ae4a

[gaim-migrate @ 10442] Simguy writes: This makes the insert link behavior a little better: 1) If there is a selection in the IMHTML to which you are inserting a link, prefill the Description field in the dialog. 2) Delete the selected text and replace it with whatever the description field contains when inserting the link (this is why we do #1) The former behavior was to prepend the description entered to the selection and link the whole block, which seemed illogical to me. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Mon, 26 Jul 2004 06:09:11 +0000
parents fd32ae5ee373
children a11bc3f5c3e3
line wrap: on
line diff
--- a/src/gtkimhtml.c	Mon Jul 26 04:05:08 2004 +0000
+++ b/src/gtkimhtml.c	Mon Jul 26 06:09:11 2004 +0000
@@ -3769,6 +3769,9 @@
 {
 	GtkTextIter iter;
 
+	if (gtk_text_buffer_get_selection_bounds(imhtml->text_buffer, NULL, NULL))
+		gtk_text_buffer_delete_selection(imhtml->text_buffer, TRUE, TRUE);
+
 	gtk_imhtml_toggle_link(imhtml, url);
 	gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &iter, mark);
 	gtk_text_buffer_insert(imhtml->text_buffer, &iter, text, -1);