Wednesday, June 2, 2010

Re: Different center alignment

On Wed, June 2, 2010 1:30 pm, Jürgen Krämer wrote:
> The replacement text
>
> \=submatch(1) . repeat(' ', &tw ? &tw : &wm ? winwidth(0) - &wm :
> winwidth(0) - len(submatch(1)) - len(submatch(2))) . submatch(2)
>

Shouldn't that be something like that
\=submatch(1) . repeat(' ', (&tw ? &tw : &wm ? winwidth(0) - &wm :
winwidth(0)) - len(submatch(1)) - len(submatch(2))) . submatch(2)

(note that added paranthesis...)

Also, one should be aware, that len and strlen returns the byte length
of its argument, but one rather would like to have the character width.
That would mean, one needs to do
len(substitute(submatch(1), '.', 'x', 'g')) to return the character width.

regards,
Christian

--
You received this message from the "vim_use" 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

No comments:

Post a Comment