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 | cff013032a4a15b17efa405ed11c74c5f6641a88 (patch) | |
tree | 1bdbb195340c93df214848e3a99c352840b31bdb | |
parent | 3ed6a18abc14b30da47f511d23f37cac8c942893 (diff) | |
download | vim-cff013032a4a15b17efa405ed11c74c5f6641a88.tar.gz |
Problem: ":diffoff" does not remove folds. (Ramel)
Solution: Do not restore 'foldenable' when 'foldmethod' is "manual".
-rw-r--r-- | src/diff.c | 13 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 13 insertions, 2 deletions
@@ -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); diff --git a/src/version.c b/src/version.c index 558649b8..eb48ddd2 100644 --- a/src/version.c +++ b/src/version.c @@ -728,6 +728,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 26, +/**/ 25, /**/ 24, |