vim -u NONE -s <(echo $'gg0VG:call writefile(getpos("\'>"), "getpos")\n:qa!')
It will end up having [0, 1, 2147483647, 0] as lines in `getpos' file,
while expected to have [0, 1, 1, 0]. Tested on vim-7.3.102 (from Gentoo repos)
and vim-7.3.138 (mercurial rev ea399ac2c1b9). Note that 2147483647 is (2**31-1).
I am on amd64.
That's intentional. Vim defines a MAXCOL value which is used to
indicate the cursor is at the end of the line without specifically
requiring knowing the line length ahead of time. This allows the
behavior to stay the same even if the line length changes. Some of its
uses are purely internal, but it does have external visibility in the
case of commands like getpos().
GPG Key: 1024D/61326D40 2003-09-02 James Vega <jame...@jamessan.com>