diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-02-13 16:10:17 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-02-13 16:10:17 +0100 |
commit | 8fe8d9ed064d1a7c41fc43a565513dc41fd3aaed (patch) | |
tree | ca6335066586190c6b3b7f73c924a91d1e47087a /src | |
parent | be9c6276665be04dbd5543467383e959cbff30c3 (diff) | |
download | vim-8fe8d9ed064d1a7c41fc43a565513dc41fd3aaed.zip |
updated for version 7.3.812
Problem: When 'indentexpr' moves the cursor "curswant" not restored.
Solution: Restore "curswant". (Sung Pae)
Diffstat (limited to 'src')
-rw-r--r-- | src/misc1.c | 14 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/misc1.c b/src/misc1.c index ab42f04db..e2c92090b 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -8809,12 +8809,18 @@ find_match(lookfor, ourscope, ind_maxparen, ind_maxcomment) get_expr_indent() { int indent; - pos_T pos; + pos_T save_pos; + colnr_T save_curswant; + int save_set_curswant; int save_State; int use_sandbox = was_set_insecurely((char_u *)"indentexpr", 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); if (use_sandbox) ++sandbox; @@ -8829,7 +8835,9 @@ get_expr_indent() * command. */ save_State = State; 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(); State = save_State; diff --git a/src/version.c b/src/version.c index 1ce53266b..4429b0f0f 100644 --- a/src/version.c +++ b/src/version.c @@ -726,6 +726,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 812, +/**/ 811, /**/ 810, |