--- gtkhtml-3.3.0.orig/src/gtkhtml.c	2004-09-13 17:30:58.000000000 +1000
+++ gtkhtml-3.3.0/src/gtkhtml.c	2004-09-17 10:51:42.087009232 +1000
@@ -3004,12 +3004,22 @@
 
 	html->priv->im_block_reset = TRUE;
 	D_IM (printf ("IM commit %s\n", str);)
-	html_engine_paste_text (html->engine, str, -1);
+
+	/* move cursor only if it's using preedit */
+	if(html->priv->im_pre_len != 0){
+		/* Move cusor before preedit pos and commit the string */
+		html_cursor_jump_to_position_no_spell (html->engine->cursor, html->engine, html->priv->im_pre_pos);
+		html_engine_paste_text (html->engine, str, -1);
+		/* Add preedit pos with number of str committed and move back */
+		html_cursor_jump_to_position_no_spell (html->engine->cursor, html->engine, html->priv->im_pre_pos+g_utf8_strlen(str, -1));
+		html->priv->im_pre_pos = html->engine->cursor->position;
+	} else 
+		html_engine_paste_text (html->engine, str, -1);
+
 	html->priv->im_block_reset = state;
 
 	D_IM (printf ("IM commit pos: %d pre_pos: %d\n", pos, html->priv->im_pre_pos);)
-	if (html->priv->im_pre_pos >= pos)
-		html->priv->im_pre_pos += html->engine->cursor->position - pos;
+
 }
 
 static void
