mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -04:00
updated for version 7.3.812
Problem: When 'indentexpr' moves the cursor "curswant" not restored. Solution: Restore "curswant". (Sung Pae)
This commit is contained in:
parent
be9c627666
commit
8fe8d9ed06
14
src/misc1.c
14
src/misc1.c
@ -8809,12 +8809,18 @@ find_match(lookfor, ourscope, ind_maxparen, ind_maxcomment)
|
|||||||
get_expr_indent()
|
get_expr_indent()
|
||||||
{
|
{
|
||||||
int indent;
|
int indent;
|
||||||
pos_T pos;
|
pos_T save_pos;
|
||||||
|
colnr_T save_curswant;
|
||||||
|
int save_set_curswant;
|
||||||
int save_State;
|
int save_State;
|
||||||
int use_sandbox = was_set_insecurely((char_u *)"indentexpr",
|
int use_sandbox = was_set_insecurely((char_u *)"indentexpr",
|
||||||
OPT_LOCAL);
|
OPT_LOCAL);
|
||||||
|
|
||||||
pos = curwin->w_cursor;
|
/* Save and restore cursor position and curswant, in case it was changed
|
||||||
|
* via :normal commands */
|
||||||
|
save_pos = curwin->w_cursor;
|
||||||
|
save_curswant = curwin->w_curswant;
|
||||||
|
save_set_curswant = curwin->w_set_curswant;
|
||||||
set_vim_var_nr(VV_LNUM, curwin->w_cursor.lnum);
|
set_vim_var_nr(VV_LNUM, curwin->w_cursor.lnum);
|
||||||
if (use_sandbox)
|
if (use_sandbox)
|
||||||
++sandbox;
|
++sandbox;
|
||||||
@ -8829,7 +8835,9 @@ get_expr_indent()
|
|||||||
* command. */
|
* command. */
|
||||||
save_State = State;
|
save_State = State;
|
||||||
State = INSERT;
|
State = INSERT;
|
||||||
curwin->w_cursor = pos;
|
curwin->w_cursor = save_pos;
|
||||||
|
curwin->w_curswant = save_curswant;
|
||||||
|
curwin->w_set_curswant = save_set_curswant;
|
||||||
check_cursor();
|
check_cursor();
|
||||||
State = save_State;
|
State = save_State;
|
||||||
|
|
||||||
|
@ -725,6 +725,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
812,
|
||||||
/**/
|
/**/
|
||||||
811,
|
811,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user