Wednesday, January 30, 2013

Re: How to determine the start of a visual block (C-V) when it starts in the void?

On Wednesday, January 30, 2013 8:06:36 AM UTC-6, Axel Bender wrote:
> Hi John,
>
> unfortunately this approach doesn't work in my situation. I'm using the same function in a mapping operating either on visuals, or on motions (:map-operator).
>
> Also, I think that if a visual block is displayed (set virtualedit=block, upper left corner in the void), then when switching to the command line and issuing :<C-U>echo virtcol("'<"), the function should return the "correct" left column, as this selection is perfectly legal in "block" mode...

I think you are missing the point.

By pressing the : key, you are no longer in visual mode. Visual mode ends the moment you enter command line mode.

John was trying to demonstrate that you can use <expr> mappings to perform an action in visual mode *without leaving visual mode*. Why exactly doesn't this method apply in your case? You can continue using the same function in both modes.

--
--
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: