diff src/search.c @ 5975:01d9ffdd6e6f v7.4.328

updated for version 7.4.328 Problem: Selection of inner block is inconsistent. Solution: Skip indent not only for '}' but all parens. (Tom McDonald)
author Bram Moolenaar <bram@vim.org>
date Tue, 17 Jun 2014 13:50:13 +0200
parents 50dbef5e774a
children 7f48abe500e1
line wrap: on
line diff
--- a/src/search.c
+++ b/src/search.c
@@ -3608,21 +3608,22 @@ current_block(oap, count, include, what,
 
     /*
      * Try to exclude the '(', '{', ')', '}', etc. when "include" is FALSE.
-     * If the ending '}' is only preceded by indent, skip that indent.
-     * But only if the resulting area is not smaller than what we started with.
+     * 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)
     {
 	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.