diff src/ex_getln.c @ 507:a1059cda45f2 v7.0142

updated for version 7.0142
author vimboss
date Tue, 06 Sep 2005 19:25:11 +0000
parents 52e76e2b5b65
children b47114409935
line wrap: on
line diff
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -2369,17 +2369,24 @@ draw_cmdline(start, len)
 	 * Do arabic shaping into a temporary buffer.  This is very
 	 * inefficient!
 	 */
-	if (len * 2 > buflen)
+	if (len * 2 + 2 > buflen)
 	{
 	    /* Re-allocate the buffer.  We keep it around to avoid a lot of
 	     * alloc()/free() calls. */
 	    vim_free(arshape_buf);
-	    buflen = len * 2;
+	    buflen = len * 2 + 2;
 	    arshape_buf = alloc(buflen);
 	    if (arshape_buf == NULL)
 		return;	/* out of memory */
 	}
 
+	if (utf_iscomposing(utf_ptr2char(ccline.cmdbuff + start)))
+	{
+	    /* Prepend a space to draw the leading composing char on. */
+	    arshape_buf[0] = ' ';
+	    newlen = 1;
+	}
+
 	for (j = start; j < start + len; j += mb_l)
 	{
 	    p = ccline.cmdbuff + j;