From: Bram Moolenaar Date: Sat, 3 Jul 2021 16:04:11 +0000 (+0200) Subject: patch 8.2.3090: in rare cases the cursor may be somewhere in a folded line X-Git-Tag: v8.2.3090 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=00aaa512d5e775e0db21e251f43d7afb8fca910f;p=vim patch 8.2.3090: in rare cases the cursor may be somewhere in a folded line 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) --- diff --git a/src/drawscreen.c b/src/drawscreen.c index 77a8a7b27..7927bedc2 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -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 diff --git a/src/version.c b/src/version.c index eb9f9f3f1..0cefeba32 100644 --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 3090, /**/ 3089, /**/