diff options
author | James McCoy <jamessan@jamessan.com> | 2016-05-06 20:34:06 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2016-05-06 20:49:19 -0400 |
commit | 3a35f63640fddbbfaaa0c4853ed29d91654809d4 (patch) | |
tree | 0a5ad219367f94fbc6511e9ab5baa0442c0da50e /src/nvim/eval.c | |
parent | f4979d368c0079288a11e8ec014cf81ad8f6bbba (diff) | |
download | rneovim-3a35f63640fddbbfaaa0c4853ed29d91654809d4.tar.gz rneovim-3a35f63640fddbbfaaa0c4853ed29d91654809d4.tar.bz2 rneovim-3a35f63640fddbbfaaa0c4853ed29d91654809d4.zip |
vim-patch:7.4.1015
Problem: The column is not restored properly when the matchparen plugin is
used in Insert mode and the cursor is after the end of the line.
Solution: Set the curswant flag. (Christian Brabandt). Also fix
highlighting the match of the character before the cursor.
https://github.com/vim/vim/commit/c21d67e33c1b42a492e04788cbb14a23a6724e39
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d84bdfebfe..cc909c5738 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -8337,6 +8337,7 @@ static void f_cursor(typval_T *argvars, typval_T *rettv) { long line, col; long coladd = 0; + bool set_curswant = true; rettv->vval.v_number = -1; if (argvars[1].v_type == VAR_UNKNOWN) { @@ -8353,6 +8354,7 @@ static void f_cursor(typval_T *argvars, typval_T *rettv) coladd = pos.coladd; if (curswant >= 0) { curwin->w_curswant = curswant - 1; + set_curswant = false; } } else { line = get_tv_lnum(argvars); @@ -8376,7 +8378,7 @@ static void f_cursor(typval_T *argvars, typval_T *rettv) if (has_mbyte) mb_adjust_cursor(); - curwin->w_set_curswant = TRUE; + curwin->w_set_curswant = set_curswant; rettv->vval.v_number = 0; } @@ -14690,6 +14692,7 @@ static void f_setpos(typval_T *argvars, typval_T *rettv) curwin->w_cursor = pos; if (curswant >= 0) { curwin->w_curswant = curswant - 1; + curwin->w_set_curswant = false; } check_cursor(); rettv->vval.v_number = 0; |