Skip to content

Commit

Permalink
updated for version 7.4.395
Browse files Browse the repository at this point in the history
Problem:    C indent is wrong below an if with wrapped condition followed by
            curly braces. (Trevor Powell)
Solution:   Make a copy of tryposBrace.
  • Loading branch information
brammool committed Aug 6, 2014
1 parent 9b352c4 commit 04d17ae
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/misc1.c
Original file line number Diff line number Diff line change
Expand Up @@ -6995,6 +6995,7 @@ get_c_indent()
char_u *linecopy;
pos_T *trypos;
pos_T *tryposBrace = NULL;
pos_T tryposBraceCopy;
pos_T our_paren_pos;
char_u *start;
int start_brace;
Expand Down Expand Up @@ -7532,7 +7533,11 @@ get_c_indent()
/*
* We are inside braces, there is a { before this line at the position
* stored in tryposBrace.
* Make a copy of tryposBrace, it may point to pos_copy inside
* find_start_brace(), which may be changed somewhere.
*/
tryposBraceCopy = *tryposBrace;
tryposBrace = &tryposBraceCopy;
trypos = tryposBrace;
ourscope = trypos->lnum;
start = ml_get(ourscope);
Expand Down
8 changes: 8 additions & 0 deletions src/testdir/test3.in
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,14 @@ label: if (asdf &&
asdfasdf
}

{
for ( int i = 0;
i < 10; i++ )
{
}
i = 0;
}

class bob
{
int foo() {return 1;}
Expand Down
8 changes: 8 additions & 0 deletions src/testdir/test3.ok
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,14 @@ label: if (asdf &&
asdfasdf
}

{
for ( int i = 0;
i < 10; i++ )
{
}
i = 0;
}

class bob
{
int foo() {return 1;}
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
395,
/**/
394,
/**/
Expand Down

0 comments on commit 04d17ae

Please sign in to comment.