summaryrefslogtreecommitdiff
path: root/src/misc1.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-08-06 17:44:14 +0200
committerBram Moolenaar <Bram@vim.org>2014-08-06 17:44:14 +0200
commit04d17ae1678846c4857cd86cf3eaf47d60c04c85 (patch)
tree124d23d766325e5ddc7d79ee3ed8547dff7e13d9 /src/misc1.c
parent9b352c46f0604288087c629381158e3e80943fbe (diff)
downloadvim-git-04d17ae1678846c4857cd86cf3eaf47d60c04c85.tar.gz
updated for version 7.4.395v7.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.
Diffstat (limited to 'src/misc1.c')
-rw-r--r--src/misc1.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/misc1.c b/src/misc1.c
index 2c28aae84..6ae72cfbb 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -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;
@@ -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);