1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
10 Patch 7.3.201 (after 7.3.195)
11 Problem: "} else" still causes following lines to be indented too much.
12 Solution: Better detection for the "else" block. (Lech Lorens)
13 Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok
16 *** ../mercurial/vim73/src/misc1.c 2011-05-19 16:35:05.000000000 +0200
17 --- src/misc1.c 2011-05-25 13:29:45.000000000 +0200
22 * When searching for a terminated line, don't use the
23 ! * one between the "if" and the "else".
24 * Need to use the scope of this "else". XXX
25 * If whilelevel != 0 continue looking for a "do {".
29 ! && ((trypos = find_start_brace(ind_maxcomment))
31 || find_match(LOOKFOR_IF, trypos->lnum,
32 ! ind_maxparen, ind_maxcomment) == FAIL))
40 * When searching for a terminated line, don't use the
41 ! * one between the "if" and the matching "else".
42 * Need to use the scope of this "else". XXX
43 * If whilelevel != 0 continue looking for a "do {".
45 ! if (cin_iselse(l) && whilelevel == 0)
47 ! /* If we're looking at "} else", let's make sure we
48 ! * find the opening brace of the enclosing scope,
49 ! * not the one from "if () {". */
51 ! curwin->w_cursor.col =
52 ! (l - ml_get_curline()) + 1;
54 ! if ((trypos = find_start_brace(ind_maxcomment))
56 || find_match(LOOKFOR_IF, trypos->lnum,
57 ! ind_maxparen, ind_maxcomment) == FAIL)
63 *** ../mercurial/vim73/src/testdir/test3.in 2011-05-19 16:35:05.000000000 +0200
64 --- src/testdir/test3.in 2011-05-25 13:23:51.000000000 +0200
77 + for (int i = 0; i < 10; ++i)
86 :g/^STARTTEST/.,/^ENDTEST/d
87 :1;/start of AUTO/,$wq! test.out
89 *** ../mercurial/vim73/src/testdir/test3.ok 2011-05-19 16:35:05.000000000 +0200
90 --- src/testdir/test3.ok 2011-05-25 13:23:51.000000000 +0200
100 + for (int i = 0; i < 10; ++i)
108 *** ../vim-7.3.200/src/version.c 2011-05-25 12:51:17.000000000 +0200
109 --- src/version.c 2011-05-25 13:33:16.000000000 +0200
113 { /* Add new patch number below this line */
119 Laughing helps. It's like jogging on the inside.
121 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
122 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
123 \\\ an exciting new programming language -- http://www.Zimbu.org ///
124 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///