On 11/02/11 11:02 PM, Dimitar DIMITROV wrote:
I just tested:

:com! Test ec '♛'
then
:Test prints ♀<fd>Q
:ec '♛' prints '♛'

So the problem is :com related not tr() as previously thought

Attached is the fix.

K_SPECIAL is not a multibyte character code, so vim_strchr is not an appropriate way to search for it. A bytewise search of the string is needed.

Ben.


-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
# HG changeset patch
# Parent 0032a84f560c4a5970cb3be1fa93d52ffe9f4d22
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -6072,8 +6072,10 @@
 		end = vim_strchr(start + 1, '>');
 	    if (buf != NULL)
 	    {
-		ksp = vim_strchr(p, K_SPECIAL);
-		if (ksp != NULL && (start == NULL || ksp < start || end == NULL)
+	    	ksp = p;
+	    	while (*ksp != NUL && *ksp != K_SPECIAL)
+	    	    ++ksp;
+		if (*ksp == K_SPECIAL && (start == NULL || ksp < start || end == NULL)
 			&& ((ksp[1] == KS_SPECIAL && ksp[2] == KE_FILLER)
 # ifdef FEAT_GUI
 			    || (ksp[1] == KS_EXTRA && ksp[2] == (int)KE_CSI)

Raspunde prin e-mail lui