soc.2008.finch: 17fa710e: Update the spell check result if removal...

sadrul at pidgin.im sadrul at pidgin.im
Tue Sep 9 23:35:29 EDT 2008


-----------------------------------------------------------------
Revision: 17fa710ebdd559c662be9f156a7dd744c01c6133
Ancestor: f47ed9fedd433524eda0463561073e512f1c0887
Author: sadrul at pidgin.im
Date: 2008-09-10T03:45:22
Branch: im.pidgin.soc.2008.finch
URL: http://d.pidgin.im/viewmtn/revision/info/17fa710ebdd559c662be9f156a7dd744c01c6133

Modified files:
        finch/libgnt/gntentry.c

ChangeLog: 

Update the spell check result if removal of whitespace causes words to merge into one.

-------------- next part --------------
============================================================
--- finch/libgnt/gntentry.c	82834964f091db42f1cee729233d6aed5ace99b9
+++ finch/libgnt/gntentry.c	3a7d9fff88a0980205f366eb7e8df98e432be690
@@ -276,6 +276,20 @@ entry_removed_range(GntEntry *entry, con
 		}
 	}
 
+	if (w && w->prev && w->start - (to - from + 1) == w->prev->start + w->prev->length) {
+		/* Whitespace was removed, causing two words to merge into one */
+		GntEntryWord *f = w;
+		w->prev->next = w->next;
+		w->prev->length += w->length;
+		if (w->next)
+			w->next->prev = w->prev;
+		if ((w->checked_spell && w->misspelled) ||
+				(w->prev->checked_spell && w->prev->misspelled))
+			check_entry_word(entry, w->prev);
+		w = w->next;
+		g_free(f);
+	}
+
 	for (; w; w = w->next) {
 		w->start -= to - from + 1;
 	}


More information about the Commits mailing list