Fix conceal feature for gj, gk, etc. (Vince Negri)
diff --git a/src/normal.c b/src/normal.c
index 002430d..e161d45 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -6664,7 +6664,7 @@
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 @@
&& 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_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;
@@ -6785,6 +6795,13 @@
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 @@
#endif
int i;
int flag = FALSE;
+#ifdef FEAT_CONCEAL
+ linenr_T oldline;
+#endif
switch (cap->nchar)
{
@@ -7847,6 +7867,9 @@
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 @@
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 @@
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;
/*