Dnia czwartek, 31 sierpnia 2006 13:09, Thomas napisaĆ:
> > This is wrong. You need:
> > let col = col(".")
> > let line = strpart(getline("."), col - 1)
>
> Unfortunately, IIRC this doesn't work with wrapped lines which is why I
> chose virtcol() ... But, well can't reproduce what I did (or thought
> that I did) 10 minutes ago. Anyway, it doesn't work with enc=utf8 and
> when there are malformed characters (not valid utf8) that are displayed
> as <xx>. Interestingly, virtcol() doesn't work in this situation either.
Solution is in Vim7::
let linearray = split(getline('.'), '.\zs')
Now you have all characters in line in separate positions in array. This
method plays nice with utf-8 characters.
m.