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.
But you're 99% right I guess. Thanks. Regards, Thomas.