0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 7.4.1732

Problem:    Folds may close when using autocomplete. (Anmol Sethi)
Solution:   Increment/decrement disable_fold. (Christian Brabandt, closes
            #643)
This commit is contained in:
Bram Moolenaar
2016-04-14 16:22:04 +02:00
parent 8110a091bc
commit 429fcfbf9a
4 changed files with 11 additions and 0 deletions

View File

@@ -1424,8 +1424,10 @@ doESCkey:
docomplete: docomplete:
compl_busy = TRUE; compl_busy = TRUE;
disable_fold_update++; /* don't redraw folds here */
if (ins_complete(c, TRUE) == FAIL) if (ins_complete(c, TRUE) == FAIL)
compl_cont_status = 0; compl_cont_status = 0;
disable_fold_update--;
compl_busy = FALSE; compl_busy = FALSE;
break; break;
#endif /* FEAT_INS_EXPAND */ #endif /* FEAT_INS_EXPAND */

View File

@@ -811,6 +811,9 @@ foldUpdate(win_T *wp, linenr_T top, linenr_T bot)
{ {
fold_T *fp; fold_T *fp;
if (disable_fold_update > 0)
return;
/* Mark all folds from top to bot as maybe-small. */ /* Mark all folds from top to bot as maybe-small. */
(void)foldFind(&wp->w_folds, top, &fp); (void)foldFind(&wp->w_folds, top, &fp);
while (fp < (fold_T *)wp->w_folds.ga_data + wp->w_folds.ga_len while (fp < (fold_T *)wp->w_folds.ga_data + wp->w_folds.ga_len

View File

@@ -1176,6 +1176,10 @@ EXTERN int fill_fold INIT(= '-');
EXTERN int fill_diff INIT(= '-'); EXTERN int fill_diff INIT(= '-');
#endif #endif
#ifdef FEAT_FOLDING
EXTERN int disable_fold_update INIT(= 0);
#endif
/* Whether 'keymodel' contains "stopsel" and "startsel". */ /* Whether 'keymodel' contains "stopsel" and "startsel". */
EXTERN int km_stopsel INIT(= FALSE); EXTERN int km_stopsel INIT(= FALSE);
EXTERN int km_startsel INIT(= FALSE); EXTERN int km_startsel INIT(= FALSE);

View File

@@ -748,6 +748,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 */
/**/
1732,
/**/ /**/
1731, 1731,
/**/ /**/