Mirror of the Vim source from https://github.com/vim/vim
Revision | 1aba098d6abc680214b3b31c954abd53ddc772ef (tree) |
---|---|
Time | 2006-07-13 15:31:00 |
Author | vimboss |
Commiter | vimboss |
updated for version 7.0-039
@@ -11321,14 +11321,19 @@ | ||
11321 | 11321 | |
11322 | 11322 | static int inputsecret_flag = 0; |
11323 | 11323 | |
11324 | -/* | |
11325 | - * "input()" function | |
11326 | - * Also handles inputsecret() when inputsecret is set. | |
11327 | - */ | |
11328 | - static void | |
11329 | -f_input(argvars, rettv) | |
11330 | - typval_T *argvars; | |
11331 | - typval_T *rettv; | |
11324 | +static void get_user_input __ARGS((typval_T *argvars, typval_T *rettv, int inputdialog)); | |
11325 | + | |
11326 | +/* | |
11327 | + * This function is used by f_input() and f_inputdialog() functions. The third | |
11328 | + * argument to f_input() specifies the type of completion to use at the | |
11329 | + * prompt. The third argument to f_inputdialog() specifies the value to return | |
11330 | + * when the user cancels the prompt. | |
11331 | + */ | |
11332 | + static void | |
11333 | +get_user_input(argvars, rettv, inputdialog) | |
11334 | + typval_T *argvars; | |
11335 | + typval_T *rettv; | |
11336 | + int inputdialog; | |
11332 | 11337 | { |
11333 | 11338 | char_u *prompt = get_tv_string_chk(&argvars[0]); |
11334 | 11339 | char_u *p = NULL; |
@@ -11378,7 +11383,7 @@ | ||
11378 | 11383 | if (defstr != NULL) |
11379 | 11384 | stuffReadbuffSpec(defstr); |
11380 | 11385 | |
11381 | - if (argvars[2].v_type != VAR_UNKNOWN) | |
11386 | + if (!inputdialog && argvars[2].v_type != VAR_UNKNOWN) | |
11382 | 11387 | { |
11383 | 11388 | char_u *xp_name; |
11384 | 11389 | int xp_namelen; |
@@ -11413,6 +11418,18 @@ | ||
11413 | 11418 | } |
11414 | 11419 | |
11415 | 11420 | /* |
11421 | + * "input()" function | |
11422 | + * Also handles inputsecret() when inputsecret is set. | |
11423 | + */ | |
11424 | + static void | |
11425 | +f_input(argvars, rettv) | |
11426 | + typval_T *argvars; | |
11427 | + typval_T *rettv; | |
11428 | +{ | |
11429 | + get_user_input(argvars, rettv, FALSE); | |
11430 | +} | |
11431 | + | |
11432 | +/* | |
11416 | 11433 | * "inputdialog()" function |
11417 | 11434 | */ |
11418 | 11435 | static void |
@@ -11452,7 +11469,7 @@ | ||
11452 | 11469 | } |
11453 | 11470 | else |
11454 | 11471 | #endif |
11455 | - f_input(argvars, rettv); | |
11472 | + get_user_input(argvars, rettv, TRUE); | |
11456 | 11473 | } |
11457 | 11474 | |
11458 | 11475 | /* |
@@ -667,6 +667,8 @@ | ||
667 | 667 | static int included_patches[] = |
668 | 668 | { /* Add new patch number below this line */ |
669 | 669 | /**/ |
670 | + 39, | |
671 | +/**/ | |
670 | 672 | 38, |
671 | 673 | /**/ |
672 | 674 | 37, |