mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
updated for version 7.2.370
Problem: A redraw may cause folds to be closed. Solution: Revert part of the previous patch. Add a test. (Lech Lorens)
This commit is contained in:
35
src/diff.c
35
src/diff.c
@@ -1117,26 +1117,31 @@ diff_win_options(wp, addbuf)
|
|||||||
win_T *wp;
|
win_T *wp;
|
||||||
int addbuf; /* Add buffer to diff. */
|
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_diff = TRUE;
|
||||||
wp->w_p_scb = TRUE;
|
wp->w_p_scb = TRUE;
|
||||||
wp->w_p_wrap = FALSE;
|
wp->w_p_wrap = FALSE;
|
||||||
# ifdef FEAT_FOLDING
|
# ifdef FEAT_FOLDING
|
||||||
{
|
curwin = wp;
|
||||||
win_T *old_curwin = curwin;
|
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);
|
OPT_LOCAL|OPT_FREE, 0);
|
||||||
curwin = old_curwin;
|
curwin = old_curwin;
|
||||||
curbuf = curwin->w_buffer;
|
curbuf = curwin->w_buffer;
|
||||||
wp->w_p_fdc = diff_foldcolumn;
|
wp->w_p_fdc = diff_foldcolumn;
|
||||||
wp->w_p_fen = TRUE;
|
wp->w_p_fen = TRUE;
|
||||||
wp->w_p_fdl = 0;
|
wp->w_p_fdl = 0;
|
||||||
foldUpdateAll(wp);
|
foldUpdateAll(wp);
|
||||||
/* make sure topline is not halfway a fold */
|
/* make sure topline is not halfway a fold */
|
||||||
changed_window_setting_win(wp);
|
changed_window_setting_win(wp);
|
||||||
}
|
|
||||||
# endif
|
# endif
|
||||||
#ifdef FEAT_SCROLLBIND
|
#ifdef FEAT_SCROLLBIND
|
||||||
if (vim_strchr(p_sbo, 'h') == NULL)
|
if (vim_strchr(p_sbo, 'h') == NULL)
|
||||||
|
@@ -854,12 +854,6 @@ foldUpdate(wp, top, bot)
|
|||||||
&& fp->fd_top < bot)
|
&& fp->fd_top < bot)
|
||||||
{
|
{
|
||||||
fp->fd_small = MAYBE;
|
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;
|
++fp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -6586,7 +6586,11 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
|
|||||||
|| *curwin->w_p_fdm == NUL)
|
|| *curwin->w_p_fdm == NUL)
|
||||||
errmsg = e_invarg;
|
errmsg = e_invarg;
|
||||||
else
|
else
|
||||||
|
{
|
||||||
foldUpdateAll(curwin);
|
foldUpdateAll(curwin);
|
||||||
|
if (foldmethodIsDiff(curwin))
|
||||||
|
newFoldLevel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
# ifdef FEAT_EVAL
|
# ifdef FEAT_EVAL
|
||||||
/* 'foldexpr' */
|
/* 'foldexpr' */
|
||||||
|
@@ -36,6 +36,8 @@ Gzk:call append("$", "folding " . getline("."))
|
|||||||
k:call append("$", getline("."))
|
k:call append("$", getline("."))
|
||||||
jAcommentstart Acommentend:set fdl=1
|
jAcommentstart Acommentend:set fdl=1
|
||||||
3j:call append("$", getline("."))
|
3j:call append("$", getline("."))
|
||||||
|
:set fdl=0
|
||||||
|
zOj:call append("$", getline("."))
|
||||||
:" test expression folding
|
:" test expression folding
|
||||||
:fun Flvl()
|
:fun Flvl()
|
||||||
let l = getline(v:lnum)
|
let l = getline(v:lnum)
|
||||||
|
@@ -11,6 +11,7 @@ indent 2
|
|||||||
folding 9 ii
|
folding 9 ii
|
||||||
3 cc
|
3 cc
|
||||||
7 gg
|
7 gg
|
||||||
|
8 hh
|
||||||
expr 2
|
expr 2
|
||||||
1
|
1
|
||||||
2
|
2
|
||||||
|
@@ -681,6 +681,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
370,
|
||||||
/**/
|
/**/
|
||||||
369,
|
369,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user