On Saturday, June 14, 2014 10:21:30 AM UTC-4, Christian Wellenbrock wrote: > On Friday, June 13, 2014 4:39:37 PM UTC+2, Tom McDonald wrote: > > Here's a recording of a demonstration of the current behaviour: > > > > https://asciinema.org/a/10129 > > I agree that this change is useful and more consistent. > > @Tom: In the meantime you could try targets.vim [1] which supports that > behavior [2]. > > [1] https://github.com/wellle/targets.vim > [2] https://github.com/wellle/targets.vim/pull/75
After looking more carefully at Vim's source, I found that current_block() is only used for (), [], {}, and <>. I see no reason why <> shouldn't be included in this behaviour, so here's an updated patch that just removes the condition entirely. -- -- 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 vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
diff -r bed71c37618c src/search.c --- a/src/search.c Thu May 29 14:36:29 2014 +0200 +++ b/src/search.c Mon Jun 16 14:58:51 2014 -0400 @@ -3608,7 +3608,8 @@ /* * Try to exclude the '(', '{', ')', '}', etc. when "include" is FALSE. - * If the ending '}' is only preceded by indent, skip that indent. + * If the ending '}', ')', or ']' is only preceded by indent, skip that + * indent. * But only if the resulting area is not smaller than what we started with. */ while (!include) @@ -3616,13 +3617,12 @@ incl(&start_pos); sol = (curwin->w_cursor.col == 0); decl(&curwin->w_cursor); - if (what == '{') - while (inindent(1)) - { - sol = TRUE; - if (decl(&curwin->w_cursor) != 0) - break; - } + while (inindent(1)) + { + sol = TRUE; + if (decl(&curwin->w_cursor) != 0) + break; + } /* * In Visual mode, when the resulting area is not bigger than what we * started with, extend it to the next block, and then exclude again.