0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

Fix conceal feature for gj, gk, etc. (Vince Negri)

This commit is contained in:
Bram Moolenaar
2010-06-08 22:59:42 +02:00
parent cdddaa46a2
commit d5b3a2cbd9

View File

@@ -6664,7 +6664,7 @@ nv_percent(cap)
cmdarg_T *cap;
{
pos_T *pos;
#ifdef FEAT_FOLDING
#if defined(FEAT_FOLDING) || defined(FEAT_CONCEAL)
linenr_T lnum = curwin->w_cursor.lnum;
#endif
@@ -6716,6 +6716,13 @@ nv_percent(cap)
&& KeyTyped)
foldOpenCursor();
#endif
#ifdef FEAT_CONCEAL
if (curwin->w_p_conceal && lnum != curwin->w_cursor.lnum)
{
update_single_line(curwin, lnum);
update_single_line(curwin, curwin->w_cursor.lnum);
}
#endif
}
/*
@@ -6770,6 +6777,9 @@ nv_mark(cap)
nv_findpar(cap)
cmdarg_T *cap;
{
#ifdef FEAT_CONCEAL
linenr_T oldline = curwin->w_cursor.lnum;
#endif
cap->oap->motion_type = MCHAR;
cap->oap->inclusive = FALSE;
cap->oap->use_reg_one = TRUE;
@@ -6784,6 +6794,13 @@ nv_findpar(cap)
#ifdef FEAT_FOLDING
if ((fdo_flags & FDO_BLOCK) && KeyTyped && cap->oap->op_type == OP_NOP)
foldOpenCursor();
#endif
#ifdef FEAT_CONCEAL
if (curwin->w_p_conceal && oldline != curwin->w_cursor.lnum)
{
update_single_line(curwin, oldline);
update_single_line(curwin, curwin->w_cursor.lnum);
}
#endif
}
}
@@ -7706,6 +7723,9 @@ nv_g_cmd(cap)
#endif
int i;
int flag = FALSE;
#ifdef FEAT_CONCEAL
linenr_T oldline;
#endif
switch (cap->nchar)
{
@@ -7847,6 +7867,9 @@ nv_g_cmd(cap)
case K_DOWN:
/* with 'nowrap' it works just like the normal "j" command; also when
* in a closed fold */
#ifdef FEAT_CONCEAL
oldline = curwin->w_cursor.lnum;
#endif
if (!curwin->w_p_wrap
#ifdef FEAT_FOLDING
|| hasFolding(curwin->w_cursor.lnum, NULL, NULL)
@@ -7860,12 +7883,22 @@ nv_g_cmd(cap)
i = nv_screengo(oap, FORWARD, cap->count1);
if (i == FAIL)
clearopbeep(oap);
#ifdef FEAT_CONCEAL
else if (curwin->w_p_conceal && oldline != curwin->w_cursor.lnum)
{
update_single_line(curwin, oldline);
update_single_line(curwin, curwin->w_cursor.lnum);
}
#endif
break;
case 'k':
case K_UP:
/* with 'nowrap' it works just like the normal "k" command; also when
* in a closed fold */
#ifdef FEAT_CONCEAL
oldline = curwin->w_cursor.lnum;
#endif
if (!curwin->w_p_wrap
#ifdef FEAT_FOLDING
|| hasFolding(curwin->w_cursor.lnum, NULL, NULL)
@@ -7879,6 +7912,13 @@ nv_g_cmd(cap)
i = nv_screengo(oap, BACKWARD, cap->count1);
if (i == FAIL)
clearopbeep(oap);
#ifdef FEAT_CONCEAL
else if (curwin->w_p_conceal && oldline != curwin->w_cursor.lnum)
{
update_single_line(curwin, oldline);
update_single_line(curwin, curwin->w_cursor.lnum);
}
#endif
break;
/*