editor: fix assert to take preedit string into account
authorPhilipp Brüschweiler <blei42@gmail.com>
Tue, 2 Oct 2012 09:06:51 +0000 (11:06 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 4 Oct 2012 15:31:14 +0000 (11:31 -0400)
clients/editor.c

index 4003e19..6b67dd3 100644 (file)
@@ -500,7 +500,8 @@ text_entry_update_layout(struct text_entry *entry)
 {
        char *text;
 
-       assert(((unsigned int)entry->cursor) <= strlen(entry->text));
+       assert(((unsigned int)entry->cursor) <= strlen(entry->text) +
+              (entry->preedit_text ? strlen(entry->preedit_text) : 0));
 
        if (!entry->preedit_text) {
                text_layout_set_text(entry->layout, entry->text);