0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

updated for version 7.4.395

Problem:    C indent is wrong below an if with wrapped condition followed by
            curly braces. (Trevor Powell)
Solution:   Make a copy of tryposBrace.
This commit is contained in:
Bram Moolenaar 2014-08-06 17:44:14 +02:00
parent 9b352c46f0
commit 04d17ae167
4 changed files with 23 additions and 0 deletions

View File

@ -6995,6 +6995,7 @@ get_c_indent()
char_u *linecopy; char_u *linecopy;
pos_T *trypos; pos_T *trypos;
pos_T *tryposBrace = NULL; pos_T *tryposBrace = NULL;
pos_T tryposBraceCopy;
pos_T our_paren_pos; pos_T our_paren_pos;
char_u *start; char_u *start;
int start_brace; int start_brace;
@ -7532,7 +7533,11 @@ get_c_indent()
/* /*
* We are inside braces, there is a { before this line at the position * We are inside braces, there is a { before this line at the position
* stored in tryposBrace. * 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; trypos = tryposBrace;
ourscope = trypos->lnum; ourscope = trypos->lnum;
start = ml_get(ourscope); start = ml_get(ourscope);

View File

@ -464,6 +464,14 @@ label: if (asdf &&
asdfasdf asdfasdf
} }
{
for ( int i = 0;
i < 10; i++ )
{
}
i = 0;
}
class bob class bob
{ {
int foo() {return 1;} int foo() {return 1;}

View File

@ -452,6 +452,14 @@ label: if (asdf &&
asdfasdf asdfasdf
} }
{
for ( int i = 0;
i < 10; i++ )
{
}
i = 0;
}
class bob class bob
{ {
int foo() {return 1;} int foo() {return 1;}

View File

@ -741,6 +741,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 */
/**/
395,
/**/ /**/
394, 394,
/**/ /**/