On Tuesday, November 19, 2013 3:34:21 PM UTC-5, Ben Fritz wrote:
> On Tuesday, November 19, 2013 1:25:48 PM UTC-6, Daniel "paradigm" Thau wrote:
> > I noticed a common pattern when using Vim:
> > - I want to operate on a text object that is not under/around the cursor
> > - The cursor is not over/in a text object of this type.
> >
> > For example, with the cursor on the "x" and a desire to operate on the
> > conditional part of the if-statement:
> >
> > x = 1;
> > ...
> > if (...) {
> > ...
> > }
> >
> > In these situations I have been moving the cursor to the object then
> > selecting the object with something like "/(<cr>vi(" or "5jf(vi(".
> >
> > However, in that situation the text-object commands don't do anything.
>
> No, in this situation the text object certainly CAN do something, because
> these text objects can be nested!
>
> Consider the [ai][{B] text object you mention. Chances are, you're inside a
> function when your cursor is on the "x=1" line. So pressing va{ should select
> the entire function body. It should not select the next block after the
> cursor.
Perhaps I was unclear. *If* the text object can do something, then it does
that thing. If there is some larger ()-object that isn't seen in my example,
then yes, that would be selected. Only if the text object command fails -
literally, it gets to the part of the code that does a "return FAIL" - does it
search forward/backward for the object. Neither this patch nor my other one
will alter normally valid Vim commands.
--
--
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
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.