1
0
forked from aniani/vim

updated for version 7.4.328

Problem:    Selection of inner block is inconsistent.
Solution:   Skip indent not only for '}' but all parens. (Tom McDonald)
This commit is contained in:
Bram Moolenaar
2014-06-17 13:50:13 +02:00
parent 8502c704ba
commit 7a54a90744
2 changed files with 12 additions and 9 deletions

View File

@@ -3608,21 +3608,22 @@ current_block(oap, count, include, what, other)
/* /*
* Try to exclude the '(', '{', ')', '}', etc. when "include" is FALSE. * 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
* But only if the resulting area is not smaller than what we started with. * indent. But only if the resulting area is not smaller than what we
* started with.
*/ */
while (!include) while (!include)
{ {
incl(&start_pos); incl(&start_pos);
sol = (curwin->w_cursor.col == 0); sol = (curwin->w_cursor.col == 0);
decl(&curwin->w_cursor); decl(&curwin->w_cursor);
if (what == '{')
while (inindent(1)) while (inindent(1))
{ {
sol = TRUE; sol = TRUE;
if (decl(&curwin->w_cursor) != 0) if (decl(&curwin->w_cursor) != 0)
break; break;
} }
/* /*
* In Visual mode, when the resulting area is not bigger than what we * 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. * started with, extend it to the next block, and then exclude again.

View File

@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
328,
/**/ /**/
327, 327,
/**/ /**/