:print command shows multibyte character with wrong color.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

:print command shows multibyte character with wrong color.

Yukihiro Nakadaira-2
:print command shows multibyte character preceded by Tab with same color
as Tab.  To reset attribute for multibyte character is forgotten.
It seems that the current code intend to show multibyte character always
with normal color.  So I think that attribute can be omitted.

*** message.c.orig Thu Jan 11 22:53:19 2007
--- message.c Thu Jan 11 22:53:19 2007
***************
*** 1595,1601 ****
     col += (*mb_ptr2cells)(s);
     mch_memmove(buf, s, (size_t)l);
     buf[l] = NUL;
!    msg_puts_attr(buf, attr);
     s += l;
     continue;
  }
--- 1595,1601 ----
     col += (*mb_ptr2cells)(s);
     mch_memmove(buf, s, (size_t)l);
     buf[l] = NUL;
!    msg_puts(buf);
     s += l;
     continue;
  }


And I wonder why ^I or <hex> formed special character is shown with
normal color.  Does the following line can be added?

*** message.c.orig Thu Jan 11 22:53:19 2007
--- message.c Thu Jan 11 22:53:19 2007
***************
*** 1635,1640 ****
--- 1635,1641 ----
  p_extra = transchar_byte(c);
  c_extra = NUL;
  c = *p_extra++;
+ attr = hl_attr(HLF_8);
     }
     else if (c == ' ' && trail != NULL && s > trail)
     {


--
Yukihiro Nakadaira - [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: :print command shows multibyte character with wrong color.

A.J.Mechelynck
Yukihiro Nakadaira wrote:
> :print command shows multibyte character preceded by Tab with same color
> as Tab.  To reset attribute for multibyte character is forgotten.
> It seems that the current code intend to show multibyte character always
> with normal color.  So I think that attribute can be omitted.

Yes, at the moment I see multibyte chars (between tabs) in blue if 'list' is
on and 'listchars' includes a "tab:" part. If 'list' is off, or if 'listchars'
does not include "tab:", the same multibyte chars are in black (using the
default GUI colors).

Best regards,
Tony.

>
> *** message.c.orig Thu Jan 11 22:53:19 2007
> --- message.c Thu Jan 11 22:53:19 2007
> ***************
> *** 1595,1601 ****
>      col += (*mb_ptr2cells)(s);
>      mch_memmove(buf, s, (size_t)l);
>      buf[l] = NUL;
> !    msg_puts_attr(buf, attr);
>      s += l;
>      continue;
>   }
> --- 1595,1601 ----
>      col += (*mb_ptr2cells)(s);
>      mch_memmove(buf, s, (size_t)l);
>      buf[l] = NUL;
> !    msg_puts(buf);
>      s += l;
>      continue;
>   }
>
>
> And I wonder why ^I or <hex> formed special character is shown with
> normal color.  Does the following line can be added?
>
> *** message.c.orig Thu Jan 11 22:53:19 2007
> --- message.c Thu Jan 11 22:53:19 2007
> ***************
> *** 1635,1640 ****
> --- 1635,1641 ----
>   p_extra = transchar_byte(c);
>   c_extra = NUL;
>   c = *p_extra++;
> + attr = hl_attr(HLF_8);
>      }
>      else if (c == ' ' && trail != NULL && s > trail)
>      {
>
>

Reply | Threaded
Open this post in threaded view
|

Re: :print command shows multibyte character with wrong color.

Bram Moolenaar
In reply to this post by Yukihiro Nakadaira-2

Yukihiro Nakadaira wrote:

> :print command shows multibyte character preceded by Tab with same color
> as Tab.  To reset attribute for multibyte character is forgotten.
> It seems that the current code intend to show multibyte character always
> with normal color.  So I think that attribute can be omitted.

Yes, that is a good fix.

> And I wonder why ^I or <hex> formed special character is shown with
> normal color.  Does the following line can be added?

This will make it clear what is literal text and what is translated.  I
suppose this will be an improvement.

--
How To Keep A Healthy Level Of Insanity:
11. Specify that your drive-through order is "to go".

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///