]> granicus.if.org Git - vim/commitdiff
patch 8.2.3112: in rare cases the cursor may be somewhere in a folded line v8.2.3112
authorBram Moolenaar <Bram@vim.org>
Mon, 5 Jul 2021 20:03:04 +0000 (22:03 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 5 Jul 2021 20:03:04 +0000 (22:03 +0200)
Problem:    With concealing enabled and indirectly closing a fold the cursor
            may be somewhere in a folded line when it is not on the first line
            of the fold.
Solution:   Check if he cursor is somewhere in the folded text.

src/drawscreen.c
src/version.c

index 5f531f2d00d6f7dce9b9764b27e5c4a94b1bab9a..da0cd130634199e3dab5268e5d2ab32ae53a95ca 100644 (file)
@@ -1382,7 +1382,10 @@ fold_line(
 
 # 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))
+    if (wp == curwin
+           && wp->w_cursor.lnum >= lnum
+           && wp->w_cursor.lnum <= lnume
+           && conceal_cursor_line(wp))
        curs_columns(TRUE);
 # endif
 }
index 0653c2797c5d7b5cf3c8a445ee0992478fe8f009..160b85f42569966f6e999a728fba57e582298723 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3112,
 /**/
     3111,
 /**/