[I'm replying again because I mixed up the recipients]

I added the MB_CHAR2LEN macro and used that instead of mb_char2len.

Does the mb_char2bytes call need a has_mbyte check as well?

Are there any other issues that need to resolved to bring this patch
forward?

Thanks!


2013/6/3 Bram Moolenaar <[email protected]>

>
> Christian Wellenbrock wrote:
>
> > Hi vim_dev,
> >
> > I recently noticed the following inconsistency regarding the 'fillchars'
> and 'statusline options:
> >
> >  - multi-byte 'fillchars' work with default 'statusline':
> >     vim -u NONE -c "set ls=2 fcs=stl:●"
> >     [No Name] [+]●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
> >
> > - single-byte 'fillchars' work with custom 'statusline':
> >     vim -u NONE -c "set ls=2 fcs=stl:x stl=a%=b"
> >     axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxb
> >
> > - multi-byte 'fillchars' with custom 'statusline' fall back to '-':
> >     vim -u NONE -c "set ls=2 fcs=stl:● stl=a%=b"
> >     a---------------------------------------------b
> >
> > I attached a patch that yields the following statusline for the last
> invocation:
> >     a●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●b
> >
> > This is my first vim contribution. Some questions I asked myself in
> > the process:
> >
> > 1. Is it ok to introduce a local variable here or should it be inlined
> instead?
> > 2. Would on big #if-#else-block be preferable to those two smaller ones?
> > 3. Should I check `has_mbyte` in the #if-#else-blocks?
>
> Thanks for the patch.  Mostly looks good.  I wonder if there is a way to
> test this.  It's probably tricky, requires getting what's actually on
> the screen (which we can't do yet).
>
> Local variables need to be declared at the start of the block.  Older
> compilers don't allow inline declarations.
>
> You snould check has_mbyte before calling mb_char2len().  There is no
> macro in macros.h yet, like there is MB_PTR2LEN().  Perhaps we should
> add one.
>
>
> --
> Q: Should I clean my house or work on Vim?
> A: Whatever contains more bugs.
>
>  /// 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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Attachment: mbfcsstl3.patch
Description: Binary data

Raspunde prin e-mail lui