mirror of
https://github.com/vim/vim.git
synced 2025-10-04 05:25:06 -04:00
patch 8.2.3625: illegal memory access when C-indenting
Problem: Illegal memory access when C-indenting. Solution: Also set the cursor column.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user