summaryrefslogtreecommitdiffstats
path: root/src/cindent.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-11-19 19:41:13 +0000
committerBram Moolenaar <Bram@vim.org>2021-11-19 19:41:13 +0000
commit2de9b7c7c8791da8853a9a7ca9c467867465b655 (patch)
treea67f2340c90c8ddee4c4dfd111ee913830e82479 /src/cindent.c
parent3ad695328f94e0197e84454f125c7f3464091d0c (diff)
patch 8.2.3625: illegal memory access when C-indentingv8.2.3625
Problem: Illegal memory access when C-indenting. Solution: Also set the cursor column.
Diffstat (limited to 'src/cindent.c')
-rw-r--r--src/cindent.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cindent.c b/src/cindent.c
index 850a369947..ad3052249d 100644
--- a/src/cindent.c
+++ b/src/cindent.c
@@ -1637,10 +1637,10 @@ get_baseclass_amount(int col)
static pos_T *
find_start_brace(void) // XXX
{
- pos_T cursor_save;
- pos_T *trypos;
- pos_T *pos;
- static pos_T pos_copy;
+ pos_T cursor_save;
+ pos_T *trypos;
+ pos_T *pos;
+ static pos_T pos_copy;
cursor_save = curwin->w_cursor;
while ((trypos = findmatchlimit(NULL, '{', FM_BLOCKSTOP, 0)) != NULL)
@@ -1654,7 +1654,7 @@ find_start_brace(void) // XXX
&& (pos = ind_find_start_CORS(NULL)) == NULL) // XXX
break;
if (pos != NULL)
- curwin->w_cursor.lnum = pos->lnum;
+ curwin->w_cursor = *pos;
}
curwin->w_cursor = cursor_save;
return trypos;