Sorry for late reply. I have been a bit busy...

http://code.google.com/p/vim/source/detail?r=01e4b4d37842ba943947058dd8da29cc46c6b490
http://code.google.com/p/vim/source/detail?r=da6ec32d8d8ff0fb5f9d6a770fbce1387fe8bbd6

Thanks Bram.
They are exactly what I needed.

On Jul 18, 10:45 pm, Bram Moolenaar <[email protected]> wrote:
> Tyru wrote:
> > I have implementedwcwidth() function.
> > Based commit was 7.2.444.
>
> > It is useful to get width of character,
> > for e.g., when creating plugin which needs to
> > align text not to exceed &columns,
> > or which needs to concern character width like tetris game :)
>
> > I'm new to hack Vim source.
> > So please tell me if I did it wrongly.
>
> I can see it is a useful function.
>
> The implementation isn't quite right, the input conversion should not be
> part of the function that counts the cells.
>
> I notice that this loop appears in multiple places, let's make a new
> function mb_string2cells() for this.
>
> The name wcwith() is a bit obscure.  How about strlencells()?
> Or strwidth()?
>
> We should also have a strchars() to count the number of characters.
> Might as well add that now.
>
> --
> DENNIS:  Listen -- strange women lying in ponds distributing swords is no
>          basis for a system of government.  Supreme executive power derives
>          from a mandate from the masses, not from some farcical aquatic
>          ceremony.
>                                   The Quest for the Holy Grail (Monty Python)
>
>  /// Bram Moolenaar -- [email protected] --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   ///

-- 
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

Raspunde prin e-mail lui