Saturday, November 30, 2013

Trouble with getpos()/setpos().

Hello all,

I've encountered a behavior which really smells like a bug, but I'd
like to check here beforehand to be sure:

Go into linewise visual mode and leave it. Show the position of the '> mark with:

echo getpos("'>")

It returns something like (if you were on line 23):

[0, 23, 2147483647, 0]

where the very big value for the column means you were in linewise
visual mode. Now try to set the '> mark with e.g.:

echo setpos("'>", [0, 25, 12, 0])

"0" is echoed, meaning nothing went wrong. Use "getpos("'>")" again to see
the position of the mark, this time you'll see:

[0, 25, 2147483647, 0]

The line was changed, but not the column. And it seems to happen
whenever the column number has that big value, i.e. whenever you went
into linewise visual mode.

Am I missing something?

Best,
Paul

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: