comparison pidgin/gtkimhtml.c @ 21488:277873603719

Fix #3930 by correctly detecting when we're no longer immediately following a br.
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 14 Nov 2007 02:56:34 +0000
parents a4b8bdc5a05f
children cba1683eeafc
comparison
equal deleted inserted replaced
21486:c8cdf0bcc8e3 21488:277873603719
1163 } 1163 }
1164 1164
1165 static void 1165 static void
1166 gtk_imhtml_undo(GtkIMHtml *imhtml) { 1166 gtk_imhtml_undo(GtkIMHtml *imhtml) {
1167 g_return_if_fail(GTK_IS_IMHTML(imhtml)); 1167 g_return_if_fail(GTK_IS_IMHTML(imhtml));
1168 g_return_if_fail(imhtml->editable); 1168 if (imhtml->editable)
1169 1169 gtk_source_undo_manager_undo(imhtml->undo_manager);
1170 gtk_source_undo_manager_undo(imhtml->undo_manager);
1171 } 1170 }
1172 1171
1173 static void 1172 static void
1174 gtk_imhtml_redo(GtkIMHtml *imhtml) { 1173 gtk_imhtml_redo(GtkIMHtml *imhtml) {
1175 g_return_if_fail(GTK_IS_IMHTML(imhtml)); 1174 g_return_if_fail(GTK_IS_IMHTML(imhtml));
1176 g_return_if_fail(imhtml->editable); 1175 if (imhtml->editable)
1177 1176 gtk_source_undo_manager_redo(imhtml->undo_manager);
1178 gtk_source_undo_manager_redo(imhtml->undo_manager);
1179 1177
1180 } 1178 }
1181 1179
1182 static gboolean imhtml_message_send(GtkIMHtml *imhtml) 1180 static gboolean imhtml_message_send(GtkIMHtml *imhtml)
1183 { 1181 {
2948 pos += tlen; 2946 pos += tlen;
2949 g_free(tag); /* This was allocated back in VALID_TAG() */ 2947 g_free(tag); /* This was allocated back in VALID_TAG() */
2950 } else if (imhtml->edit.link == NULL && 2948 } else if (imhtml->edit.link == NULL &&
2951 gtk_imhtml_is_smiley(imhtml, fonts, c, &smilelen)) { 2949 gtk_imhtml_is_smiley(imhtml, fonts, c, &smilelen)) {
2952 GtkIMHtmlFontDetail *fd; 2950 GtkIMHtmlFontDetail *fd;
2953
2954 gchar *sml = NULL; 2951 gchar *sml = NULL;
2952
2953 br = FALSE;
2954
2955 if (fonts) { 2955 if (fonts) {
2956 fd = fonts->data; 2956 fd = fonts->data;
2957 sml = fd->sml; 2957 sml = fd->sml;
2958 } 2958 }
2959 if (!sml) 2959 if (!sml)
2967 c += smilelen; 2967 c += smilelen;
2968 pos += smilelen; 2968 pos += smilelen;
2969 wpos = 0; 2969 wpos = 0;
2970 ws[0] = 0; 2970 ws[0] = 0;
2971 } else if (*c == '&' && (amp = purple_markup_unescape_entity(c, &tlen))) { 2971 } else if (*c == '&' && (amp = purple_markup_unescape_entity(c, &tlen))) {
2972 br = FALSE;
2972 while(*amp) { 2973 while(*amp) {
2973 ws [wpos++] = *amp++; 2974 ws [wpos++] = *amp++;
2974 } 2975 }
2975 c += tlen; 2976 c += tlen;
2976 pos += tlen; 2977 pos += tlen;
2995 wpos = 0; 2996 wpos = 0;
2996 } 2997 }
2997 c++; 2998 c++;
2998 pos++; 2999 pos++;
2999 } else if ((len_protocol = gtk_imhtml_is_protocol(c)) > 0){ 3000 } else if ((len_protocol = gtk_imhtml_is_protocol(c)) > 0){
3001 br = FALSE;
3000 while(len_protocol--){ 3002 while(len_protocol--){
3001 /* Skip the next len_protocol characters, but make sure they're 3003 /* Skip the next len_protocol characters, but make sure they're
3002 copied into the ws array. 3004 copied into the ws array.
3003 */ 3005 */
3004 ws [wpos++] = *c++; 3006 ws [wpos++] = *c++;
3005 pos++; 3007 pos++;
3006 } 3008 }
3007 } else if (*c) { 3009 } else if (*c) {
3010 br = FALSE;
3008 ws [wpos++] = *c++; 3011 ws [wpos++] = *c++;
3009 pos++; 3012 pos++;
3010 } else { 3013 } else {
3011 break; 3014 break;
3012 } 3015 }