vim-patch: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.

https://code.google.com/p/vim/source/detail?r=v7-4-395
This commit is contained in:
Florian Walch 2014-12-23 10:24:46 +01:00
parent c3de63bfbc
commit 1053f49ab0
4 changed files with 22 additions and 1 deletions

View File

@ -1545,6 +1545,7 @@ int get_c_indent(void)
char_u *linecopy;
pos_T *trypos;
pos_T *tryposBrace = NULL;
pos_T tryposBraceCopy;
pos_T our_paren_pos;
char_u *start;
int start_brace;
@ -2026,6 +2027,10 @@ int get_c_indent(void)
} else {
// 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);

View File

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

View File

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

View File

@ -342,7 +342,7 @@ static int included_patches[] = {
//398 NA
397,
//396,
//395,
395,
//394 NA
//393 NA
392,