Christian Brabandt wrote:
> Hi lith!
>
> On So, 11 Nov 2012, lith wrote:
>
> > Am Sonntag, 11. November 2012 10:03:49 UTC+1 schrieb ZyX:
> > > > Is this intended? Is there an (easy) way to make printf() respect
> > > > multi-byte encodings?
> > > It is clearly stated in documentation that printf() operates with
> > > bytes.
> >
> > My question rather was am I missing something since I personally find
> > this behaviour rather useless in the context of a text editor.
> >
> > A formatted string usually is something that should eventually be
> > displayed in a vim buffer. When I want to get a string padded with
> > whitespace, I'm almost always rather interested in its display width
> > than in its size in bytes -- and I can hardly imagine a use case where
> > it would be otherwise.
> >
> > I can work around this problem by adjusting the width dependent on the
> > difference between len(s) and strwidth(s) but I personally find this
> > unnecessarily complicated.
>
> I guess, we could use the 'S' type for printf() to specify length is
> given in char (see patch).
Thanks. I think it's good that without the +multi_byte feature 'S'
works just like 's', that's easier for script writers.
I also fixed a signed/unsigned comparison that my compiler complained
about.
--
How To Keep A Healthy Level Of Insanity:
18. When leaving the zoo, start running towards the parking lot,
yelling "run for your lives, they're loose!!"
/// 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