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.

c21d67e33c
This commit is contained in:
James McCoy
2016-05-06 20:34:06 -04:00
parent f4979d368c
commit 3a35f63640
3 changed files with 7 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
" Vim plugin for showing matching parens
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2014 Jul 19
" Last Change: 2015 Dec 31
" Exit quickly when:
" - this plugin was already loaded (or disabled)
@@ -55,7 +55,7 @@ function! s:Highlight_Matching_Pair()
let before = 0
let text = getline(c_lnum)
let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\)')
let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\=\)')
if empty(matches)
let [c_before, c] = ['', '']
else

View File

@@ -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;

View File

@@ -663,7 +663,7 @@ static int included_patches[] = {
// 1018,
// 1017,
// 1016 NA
// 1015,
1015,
// 1014 NA
1013,
// 1012 NA