statusbar width with multibyte characters in it

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

statusbar width with multibyte characters in it

Daniel Albuschat
Hello,

I've noticed that the width of the statusbar is incorrect when
there are multibyte characters in the statusbar text.

I've made two screenshots. One with LC_ALL set to ja_JP@UTF-8,
the other with LC_ALL=en_US:

http://viming.de/vim_status_broken.png
http://viming.de/vim_status_ok.png

This happened with a newly cvs checked-out vim7.

I've crossposted to vim-multibyte and vim-dev because I was
unsure who cares most about this bug. Sorry if I was wrong ;-)

Bye,
   Daniel Albuschat
Reply | Threaded
Open this post in threaded view
|

Re: statusbar width with multibyte characters in it

Yasuhiro Matsumoto

> I've noticed that the width of the statusbar is incorrect when
> there are multibyte characters in the statusbar text.
>
> I've made two screenshots. One with LC_ALL set to ja_JP@UTF-8,
> the other with LC_ALL=en_US:
>
> http://viming.de/vim_status_broken.png
> http://viming.de/vim_status_ok.png
>
> This happened with a newly cvs checked-out vim7.
[snip]

I don't see this wrong behavior in vim7 cvs-head on my linux.
(If you use old FreeBSD, some mb* or wc* functions in libc have a bug)

I tried following setting.
:set statusline=%<%f\ %m%r%h%w%{''.strftime('%c').''}%=%l,%c%V%8P
but it seems ok to me.

I guess that 'vim_status_ok.png' is not also correct.
'22%' should fit at right side.

What value did you set to statusline?

Regards,

- Yasuhiro


Reply | Threaded
Open this post in threaded view
|

Re: statusbar width with multibyte characters in it

Bram Moolenaar
In reply to this post by Daniel Albuschat

Daniel Albuschat wrote:

> I've noticed that the width of the statusbar is incorrect when
> there are multibyte characters in the statusbar text.
>
> I've made two screenshots. One with LC_ALL set to ja_JP@UTF-8,
> the other with LC_ALL=3Den_US:
>
> http://viming.de/vim_status_broken.png
> http://viming.de/vim_status_ok.png
>
> This happened with a newly cvs checked-out vim7.
>
> I've crossposted to vim-multibyte and vim-dev because I was
> unsure who cares most about this bug. Sorry if I was wrong ;-)

What is the value of your 'statusline' option?  I tried a few values but
don't get something that looks like your screenshots.

--
ARTHUR: Charge!
   [They all charge with swords drawn towards the RABBIT.  A tremendous twenty
   second fight with Peckinpahish shots and borrowing heavily also on the
   Kung Fu and karate-type films ensues, in which some four KNIGHTS are
   comprehensively killed.]
ARTHUR: Run away!  Run away!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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://www.ICCF.nl         ///
Reply | Threaded
Open this post in threaded view
|

Re: statusbar width with multibyte characters in it

Daniel Albuschat
In reply to this post by Yasuhiro Matsumoto
2005/12/16, Matsumoto Yasuhiro <[hidden email]>:
> I don't see this wrong behavior in vim7 cvs-head on my linux.
> (If you use old FreeBSD, some mb* or wc* functions in libc have a bug)
>
> I tried following setting.
> :set statusline=%<%f\ %m%r%h%w%{''.strftime('%c').''}%=%l,%c%V%8P
> but it seems ok to me.

I think I got it wrong. It's the ruler, not the statusline:
set ruler
set rulerformat=%55(%{strftime('%a\ %b\ %e\ %I:%M\ %p')}\ %5L,%-6(%c%V%)\ %P%)

When I change ruler not to include the time, it's okay.
statusline is not set at all (:set statusline yields "  statusline=").

--
eat(this); // delicious suicide
Reply | Threaded
Open this post in threaded view
|

Re: statusbar width with multibyte characters in it

Bram Moolenaar

Daniel Albuschat wrote:

> 2005/12/16, Matsumoto Yasuhiro <[hidden email]>:
> > I don't see this wrong behavior in vim7 cvs-head on my linux.
> > (If you use old FreeBSD, some mb* or wc* functions in libc have a bug)
> >
> > I tried following setting.
> > :set statusline=%<%f\ %m%r%h%w%{''.strftime('%c').''}%=%l,%c%V%8P
> > but it seems ok to me.
>
> I think I got it wrong. It's the ruler, not the statusline:
> set ruler
> set rulerformat=%55(%{strftime('%a\ %b\ %e\ %I:%M\ %p')}\ %5L,%-6(%c%V%)\ %P%)
>
> When I change ruler not to include the time, it's okay.
> statusline is not set at all (:set statusline yields "  statusline=").

This still works OK for me, although 55 is very wide and there is lots
of room on the right.

Perhaps your 'fillchars' option is part of the problem?

--
An indication you must be a manager:
You believe you never have any problems in your life, just
"issues" and "improvement opportunities".

 /// 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://www.ICCF.nl         ///