On Tue, Mar 8, 2011 at 9:53 AM, ZyX <[email protected]> wrote:
> Consider the following script:
>
>    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].

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().

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[email protected]>

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui