diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-02-24 14:34:19 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-02-24 14:34:19 +0100 |
commit | f4d7f944baf3e6aaf8a17e9b6fae54e96d121be5 (patch) | |
tree | 0aef5f7b9ec4885df7d45d58c312236111752e0d /src/diff.c | |
parent | 54c1b4965b6072352d84c41fb4101e8a2214cc6b (diff) | |
download | vim-git-f4d7f944baf3e6aaf8a17e9b6fae54e96d121be5.tar.gz |
updated for version 7.2.370v7.2.370
Problem: A redraw may cause folds to be closed.
Solution: Revert part of the previous patch. Add a test. (Lech Lorens)
Diffstat (limited to 'src/diff.c')
-rw-r--r-- | src/diff.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/diff.c b/src/diff.c index f5ea0c692..bf6254598 100644 --- a/src/diff.c +++ b/src/diff.c @@ -1117,26 +1117,31 @@ diff_win_options(wp, addbuf) win_T *wp; int addbuf; /* Add buffer to diff. */ { +# ifdef FEAT_FOLDING + win_T *old_curwin = curwin; + + /* close the manually opened folds */ + curwin = wp; + newFoldLevel(); + curwin = old_curwin; +# endif + wp->w_p_diff = TRUE; wp->w_p_scb = TRUE; wp->w_p_wrap = FALSE; # ifdef FEAT_FOLDING - { - win_T *old_curwin = curwin; - - curwin = wp; - curbuf = curwin->w_buffer; - set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff", + curwin = wp; + curbuf = curwin->w_buffer; + set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff", OPT_LOCAL|OPT_FREE, 0); - curwin = old_curwin; - curbuf = curwin->w_buffer; - wp->w_p_fdc = diff_foldcolumn; - wp->w_p_fen = TRUE; - wp->w_p_fdl = 0; - foldUpdateAll(wp); - /* make sure topline is not halfway a fold */ - changed_window_setting_win(wp); - } + curwin = old_curwin; + curbuf = curwin->w_buffer; + wp->w_p_fdc = diff_foldcolumn; + wp->w_p_fen = TRUE; + wp->w_p_fdl = 0; + foldUpdateAll(wp); + /* make sure topline is not halfway a fold */ + changed_window_setting_win(wp); # endif #ifdef FEAT_SCROLLBIND if (vim_strchr(p_sbo, 'h') == NULL) |