mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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:
parent
c3de63bfbc
commit
1053f49ab0
@ -1545,6 +1545,7 @@ int get_c_indent(void)
|
|||||||
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;
|
||||||
@ -2026,6 +2027,10 @@ int get_c_indent(void)
|
|||||||
} else {
|
} else {
|
||||||
// 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);
|
||||||
|
@ -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;}
|
||||||
|
@ -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;}
|
||||||
|
@ -342,7 +342,7 @@ static int included_patches[] = {
|
|||||||
//398 NA
|
//398 NA
|
||||||
397,
|
397,
|
||||||
//396,
|
//396,
|
||||||
//395,
|
395,
|
||||||
//394 NA
|
//394 NA
|
||||||
//393 NA
|
//393 NA
|
||||||
392,
|
392,
|
||||||
|
Loading…
Reference in New Issue
Block a user