How can I get the length of the current row in vim script?
To get the current line you can use
:h getline() giving it the parameter
'.'. This will return a string, all you have to do next is to get the length of this string, to do so you have several options:
strlen() length of a string in bytes strchars() length of a string in characters strwidth() size of string when displayed strdisplaywidth() size of string when displayed, deals with tabs
So your code could be:
let size = strwidth(getline('.'))