When non-printable character (e.g. ^@) in wrapped line is displayed as
following, position of the cursor on the "bbb..." is not correct.
  |aaaaaaaaaaa^|
  |@bbbbbbb    |
'incsearch' highlighting is also wrong.  This occurs when using multi-byte
encoding.

Please check this patch.

Index: charset.c
===================================================================
--- charset.c   (revision 867)
+++ charset.c   (working copy)
@@ -1280,17 +1280,12 @@
 #ifdef FEAT_MBYTE
                if (has_mbyte)
                {
-                   /* For utf-8, if the byte is >= 0x80, need to look at
-                    * further bytes to find the cell width. */
-                   if (enc_utf8 && c >= 0x80)
-                       incr = utf_ptr2cells(ptr);
-                   else
-                       incr = CHARSIZE(c);
-
+                   incr = ptr2cells(ptr);
                    /* If a double-cell char doesn't fit at the end of a line
                     * it wraps to the next line, it's like this char is three
-                    * cells wide. */
-                   if (incr == 2 && wp->w_p_wrap && in_win_border(wp, vcol))
+                    * cells wide.  Don't do it for non-printable character.*/
+                   if (incr == 2 && wp->w_p_wrap && in_win_border(wp, vcol)
+                           && vim_isprintc(PTR2CHAR(ptr)))
                    {
                        ++incr;
                        head = 1;

-- 
Yukihiro Nakadaira - [EMAIL PROTECTED]



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui