comparison src/edit.c @ 1927:f798c9043986 v7.2.224

updated for version 7.2-224
author vimboss
date Thu, 09 Jul 2009 16:15:16 +0000
parents 04613e770ec0
children e5145ff9c9b0
comparison
equal deleted inserted replaced
1926:43d337097e4c 1927:f798c9043986
111 static int compl_restarting = FALSE; /* don't insert match */ 111 static int compl_restarting = FALSE; /* don't insert match */
112 112
113 /* When the first completion is done "compl_started" is set. When it's 113 /* When the first completion is done "compl_started" is set. When it's
114 * FALSE the word to be completed must be located. */ 114 * FALSE the word to be completed must be located. */
115 static int compl_started = FALSE; 115 static int compl_started = FALSE;
116
117 /* Set when doing something for completion that may call edit() recursively,
118 * which is not allowed. */
119 static int compl_busy = FALSE;
116 120
117 static int compl_matches = 0; 121 static int compl_matches = 0;
118 static char_u *compl_pattern = NULL; 122 static char_u *compl_pattern = NULL;
119 static int compl_direction = FORWARD; 123 static int compl_direction = FORWARD;
120 static int compl_shows_dir = FORWARD; 124 static int compl_shows_dir = FORWARD;
344 return FALSE; 348 return FALSE;
345 } 349 }
346 350
347 #ifdef FEAT_INS_EXPAND 351 #ifdef FEAT_INS_EXPAND
348 /* Don't allow recursive insert mode when busy with completion. */ 352 /* Don't allow recursive insert mode when busy with completion. */
349 if (compl_started || pum_visible()) 353 if (compl_started || compl_busy || pum_visible())
350 { 354 {
351 EMSG(_(e_secure)); 355 EMSG(_(e_secure));
352 return FALSE; 356 return FALSE;
353 } 357 }
354 ins_compl_clear(); /* clear stuff for CTRL-X mode */ 358 ins_compl_clear(); /* clear stuff for CTRL-X mode */
1338 && ctrl_x_mode != 0 1342 && ctrl_x_mode != 0
1339 && !(compl_cont_status & CONT_LOCAL)) 1343 && !(compl_cont_status & CONT_LOCAL))
1340 goto normalchar; 1344 goto normalchar;
1341 1345
1342 docomplete: 1346 docomplete:
1347 compl_busy = TRUE;
1343 if (ins_complete(c) == FAIL) 1348 if (ins_complete(c) == FAIL)
1344 compl_cont_status = 0; 1349 compl_cont_status = 0;
1350 compl_busy = FALSE;
1345 break; 1351 break;
1346 #endif /* FEAT_INS_EXPAND */ 1352 #endif /* FEAT_INS_EXPAND */
1347 1353
1348 case Ctrl_Y: /* copy from previous line or scroll down */ 1354 case Ctrl_Y: /* copy from previous line or scroll down */
1349 case Ctrl_E: /* copy from next line or scroll up */ 1355 case Ctrl_E: /* copy from next line or scroll up */
3170 for (i = 0; i < CPT_COUNT; ++i) 3176 for (i = 0; i < CPT_COUNT; ++i)
3171 vim_free(match->cp_text[i]); 3177 vim_free(match->cp_text[i]);
3172 vim_free(match); 3178 vim_free(match);
3173 } while (compl_curr_match != NULL && compl_curr_match != compl_first_match); 3179 } while (compl_curr_match != NULL && compl_curr_match != compl_first_match);
3174 compl_first_match = compl_curr_match = NULL; 3180 compl_first_match = compl_curr_match = NULL;
3181 compl_shown_match = NULL;
3175 } 3182 }
3176 3183
3177 static void 3184 static void
3178 ins_compl_clear() 3185 ins_compl_clear()
3179 { 3186 {