| To: vim-dev@vim.org |
| Subject: Patch 7.2.370 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.2.370 (after 7.2.356) |
| Problem: A redraw may cause folds to be closed. |
| Solution: Revert part of the previous patch. Add a test. (Lech Lorens) |
| Files: src/diff.c, src/fold.c, src/option.c, src/testdir/test45.in, |
| src/testdir/test45.ok |
| |
| |
| |
| |
| |
| *** 1117,1142 **** |
| win_T *wp; |
| int addbuf; /* Add buffer to diff. */ |
| { |
| 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", |
| 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); |
| ! } |
| # endif |
| #ifdef FEAT_SCROLLBIND |
| if (vim_strchr(p_sbo, 'h') == NULL) |
| --- 1117,1147 ---- |
| 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 |
| ! 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); |
| # endif |
| #ifdef FEAT_SCROLLBIND |
| if (vim_strchr(p_sbo, 'h') == NULL) |
| |
| |
| |
| *** 854,865 **** |
| && fp->fd_top < bot) |
| { |
| fp->fd_small = MAYBE; |
| - |
| - /* Not sure if this is the right place to reset fd_flags (suggested by |
| - * Lech Lorens). */ |
| - if (wp->w_foldinvalid) |
| - fp->fd_flags = FD_LEVEL; |
| - |
| ++fp; |
| } |
| |
| --- 854,859 ---- |
| |
| |
| |
| *** 6586,6592 **** |
| --- 6586,6596 ---- |
| || *curwin->w_p_fdm == NUL) |
| errmsg = e_invarg; |
| else |
| + { |
| foldUpdateAll(curwin); |
| + if (foldmethodIsDiff(curwin)) |
| + newFoldLevel(); |
| + } |
| } |
| # ifdef FEAT_EVAL |
| /* 'foldexpr' */ |
| |
| |
| |
| *** 36,41 **** |
| --- 36,43 ---- |
| k:call append("$", getline(".")) |
| jAcommentstart Acommentend:set fdl=1 |
| 3j:call append("$", getline(".")) |
| + :set fdl=0 |
| + zOj:call append("$", getline(".")) |
| :" test expression folding |
| :fun Flvl() |
| let l = getline(v:lnum) |
| |
| |
| |
| *** 11,16 **** |
| --- 11,17 ---- |
| folding 9 ii |
| 3 cc |
| 7 gg |
| + 8 hh |
| expr 2 |
| 1 |
| 2 |
| |
| |
| |
| *** 683,684 **** |
| --- 683,686 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 370, |
| /**/ |
| |
| -- |
| MAN: Fetchez la vache! |
| GUARD: Quoi? |
| MAN: Fetchez la vache! |
| "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ download, build and distribute -- http://www.A-A-P.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |