diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-07-17 13:43:39 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-07-17 13:43:39 +0200 |
commit | 33ca6bf240981363f3dfb259e3715ce4ee3302b3 (patch) | |
tree | e99cfd2c92c7938bf97f5e596554ccbad8d1ff6f /src/diff.c | |
parent | 56667a5d3ed3a45f06c8b7e6485eb6ab742a7302 (diff) |
updated for version 7.4a.026v7.4a.026
Problem: ":diffoff" does not remove folds. (Ramel)
Solution: Do not restore 'foldenable' when 'foldmethod' is "manual".
Diffstat (limited to 'src/diff.c')
-rw-r--r-- | src/diff.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/diff.c b/src/diff.c index 92648a3615..80f4473144 100644 --- a/src/diff.c +++ b/src/diff.c @@ -1235,10 +1235,19 @@ ex_diffoff(eap) curbuf = curwin->w_buffer; if (wp->w_p_fdc == diff_foldcolumn) wp->w_p_fdc = wp->w_p_diff_saved ? wp->w_p_fdc_save : 0; - if (wp->w_p_fen) - wp->w_p_fen = wp->w_p_diff_saved ? wp->w_p_fen_save : FALSE; if (wp->w_p_fdl == 0 && wp->w_p_diff_saved) wp->w_p_fdl = wp->w_p_fdl_save; + + if (wp->w_p_fen) + { + /* Only restore 'foldenable' when 'foldmethod' is not + * "manual", otherwise we continue to show the diff folds. */ + if (foldmethodIsManual(wp) || !wp->w_p_diff_saved) + wp->w_p_fen = FALSE; + else + wp->w_p_fen = wp->w_p_fen_save; + } + foldUpdateAll(wp); /* make sure topline is not halfway a fold */ changed_window_setting_win(wp); |