Yukihiro Nakadaira wrote:

> When typing mapped character, Vim shows partially matched character.  On
> command-line, it causes multi-byte character display problem.
> 
> Steps to reproduce:
> 
>   $ vim -u NONE -N
>   :cnoremap aa <Nop>
>   :cnoremap ab <Nop>
>   :SOME_MULTI_BYTE_CHARACTER        " type multibyte character
>   Then, move cursor on multi-byte character with <Left> and type "aa".
>   First byte of the character will be shown as <xx> form.
> 
> The following patch fix this problem.
> Please check it.
> 
> diff -r 9cb3a75a20b9 src/ex_getln.c
> --- a/src/ex_getln.c  Fri Jun 01 22:38:45 2012 +0200
> +++ b/src/ex_getln.c  Tue Jun 05 21:01:38 2012 +0900
> @@ -2764,6 +2764,11 @@
>      msg_no_more = TRUE;
>      if (ccline.cmdlen == ccline.cmdpos)
>       msg_putchar(' ');
> +#ifdef FEAT_MBYTE
> +    else if (has_mbyte)
> +     draw_cmdline(ccline.cmdpos,
> +                             (*mb_ptr2len)(ccline.cmdbuff + ccline.cmdpos));
> +#endif
>      else
>       draw_cmdline(ccline.cmdpos, 1);
>      msg_no_more = FALSE;

Thanks!

I also notice the cursor position is wrong after typing "aa".
And I can fix that.

-- 
For a moment, nothing happened.
Then, after a second or so, nothing continued to happen.
                -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
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

Raspunde prin e-mail lui