119335Re: How to find start/end of char-wise visual selection?
- Nov 30, 2010On Wed, December 1, 2010 4:26 am, AK wrote:
>Yeah, I remember, I wondered about it too. I even thought about creating
> Hi, this is for Vim7.3.. Looking up docs for line(), it says that
> arg='.' will give you cursor position, and 'v' will give you beginning
> of visual selection when in visual mode, and '.' will give you the end
> of it. For column, col() should be used, but there's no 'v' arg for it.
a patch, but didn't so far, because you can easily get the column using
the getpos() function together with the marks '< for start and '> for end
of visual selection. For my plugin NrrwRgn, I use getpos("'>") for the line
and virtcol("'>") for the virtual column of the end of the visual selection
(and the same for the start of the visual selection).
> So, how can I do this? Let's say I have a char-wise selection fromecho "start at line " getpos("'<") " column: " virtcol("'<")
> column 10 to 20, how can I get numbers 10 and 20? -ak
echo "end at line " getpos("'>") " column: " virtcol("'>")
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
- << Previous post in topic Next post in topic >>