Ответ на сообщение «Re: col() in lines with apostrophe characters»,
присланное в 20:15:39 14 марта 2010, Воскресенье,
отправитель Ingo Karkat:
let len = strlen(substitute(str, ., x, g))
Never use this. It is three orders of magnitude slower than
let len=len(split(str, '\zs'))
You can
Am 14.03.2010 18:15, schrieb Ingo Karkat:
On 14-Mar-2010 17:49, Gregor Uhlenheuer wrote:
Hello,
I think the col() function does not work properly for lines with
apostrophe characters (`´).
:echo col([line('.'), '$']) returns 6 on the line below:
´foo
It should return 5 I think
On 15-Mar-2010 11:21, Gregor Uhlenheuer wrote:
Since you nearly guessed my use of col() - I want to get the length of
the current line - thank you for the tip with the substitution. I
figured that using virtcol() is probably more appropriate for that
purpose.
Well, call it psychic debugging
On 15-Mar-2010 18:57, ZyX wrote:
Ответ на сообщение Re: col() in lines with apostrophe characters,
присланное в 20:15:39 14 марта 2010, Воскресенье,
отправитель Ingo Karkat:
let len = strlen(substitute(str, ., x, g))
Never use this. It is three orders of magnitude slower than
let
Hello,
I think the col() function does not work properly for lines with
apostrophe characters (`´).
:echo col([line('.'), '$']) returns 6 on the line below:
´foo
It should return 5 I think.
Regards,
Gregor Uhlenheuer
--
You received this message from the vim_dev maillist.
Do not top-post
On 14-Mar-2010 17:49, Gregor Uhlenheuer wrote:
Hello,
I think the col() function does not work properly for lines with
apostrophe characters (`´).
:echo col([line('.'), '$']) returns 6 on the line below:
´foo
It should return 5 I think.
It depends on the encoding of the apostrophe character