]> granicus.if.org Git - vim/commitdiff
patch 8.2.3090: in rare cases the cursor may be somewhere in a folded line v8.2.3090
authorBram Moolenaar <Bram@vim.org>
Sat, 3 Jul 2021 16:04:11 +0000 (18:04 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 3 Jul 2021 16:04:11 +0000 (18:04 +0200)
Problem:    With concealing enabled and indirectly closing a fold the cursor
            may be somewhere in a folded line.
Solution:   Recompute the cursor position when the cursor line can be
            concealed. (closes #8480)

src/drawscreen.c
src/version.c

index 77a8a7b2768444d6c178549f68d3c0819ff75c7c..7927bedc23000764893998d4f271d70f39e077ee 100644 (file)
@@ -1379,6 +1379,12 @@ fold_line(
        curwin->w_cline_folded = TRUE;
        curwin->w_valid |= (VALID_CHEIGHT|VALID_CROW);
     }
+
+# ifdef FEAT_CONCEAL
+    // When the line was not folded w_wrow may have been set, recompute it.
+    if (wp == curwin && lnum == wp->w_cursor.lnum && conceal_cursor_line(wp))
+       curs_columns(TRUE);
+# endif
 }
 #endif
 
index eb9f9f3f12139e93d1f508dd68ed4b58ee9ac7e6..0cefeba32b30ea1e6362dc52b83331023ba108e1 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3090,
 /**/
     3089,
 /**/