Skip to content

Commit 19611df

Browse files
committed
updated for version 7.4a.026
Problem: ":diffoff" does not remove folds. (Ramel) Solution: Do not restore 'foldenable' when 'foldmethod' is "manual".
1 parent 2d39fcc commit 19611df

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/diff.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,10 +1235,19 @@ ex_diffoff(eap)
12351235
curbuf = curwin->w_buffer;
12361236
if (wp->w_p_fdc == diff_foldcolumn)
12371237
wp->w_p_fdc = wp->w_p_diff_saved ? wp->w_p_fdc_save : 0;
1238-
if (wp->w_p_fen)
1239-
wp->w_p_fen = wp->w_p_diff_saved ? wp->w_p_fen_save : FALSE;
12401238
if (wp->w_p_fdl == 0 && wp->w_p_diff_saved)
12411239
wp->w_p_fdl = wp->w_p_fdl_save;
1240+
1241+
if (wp->w_p_fen)
1242+
{
1243+
/* Only restore 'foldenable' when 'foldmethod' is not
1244+
* "manual", otherwise we continue to show the diff folds. */
1245+
if (foldmethodIsManual(wp) || !wp->w_p_diff_saved)
1246+
wp->w_p_fen = FALSE;
1247+
else
1248+
wp->w_p_fen = wp->w_p_fen_save;
1249+
}
1250+
12421251
foldUpdateAll(wp);
12431252
/* make sure topline is not halfway a fold */
12441253
changed_window_setting_win(wp);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ static char *(features[]) =
727727

728728
static int included_patches[] =
729729
{ /* Add new patch number below this line */
730+
/**/
731+
26,
730732
/**/
731733
25,
732734
/**/

0 commit comments

Comments
 (0)