message = tv_get_string_chk(&argvars[0]);
if (message == NULL)
error = TRUE;
- else
- set_prompt(message);
if (argvars[1].v_type != VAR_UNKNOWN)
{
buttons = tv_get_string_buf_chk(&argvars[1], buf);
#ifdef FEAT_EVAL
static int new_cmdpos; // position set by set_cmdline_pos()
-static char_u current_prompt[CMDBUFFSIZE + 1] = "";
#endif
static int extra_char = NUL; // extra character to display when redrawing
static void draw_cmdline(int start, int len);
static void save_cmdline(cmdline_info_T *ccp);
static void restore_cmdline(cmdline_info_T *ccp);
-#ifdef FEAT_EVAL
-static char_u *get_prompt(void);
-#endif
static int cmdline_paste(int regname, int literally, int remcr);
static void redrawcmdprompt(void);
static int ccheck_abbr(int);
rettv->vval.v_string = get_cmdline_str();
}
-/*
- * Get current command line prompt.
- */
- static char_u *
-get_prompt(void)
-{
- return current_prompt;
-}
-
-/*
- * Set current command line prompt.
- */
- void
-set_prompt(char_u* str)
-{
- vim_strncpy(current_prompt, str, sizeof(current_prompt) - 1);
-}
-
/*
* "getcmdpos()" function
*/
{
cmdline_info_T *p = get_ccline_ptr();
rettv->v_type = VAR_STRING;
- rettv->vval.v_string = p != NULL ? vim_strsave(get_prompt()) : NULL;
+ rettv->vval.v_string = p != NULL && p->cmdprompt != NULL ?
+ vim_strsave(p->cmdprompt) : NULL;
}
/*
cmd_silent = FALSE; // Want to see the prompt.
if (prompt != NULL)
{
- set_prompt(prompt);
-
// Only the part of the message after the last NL is considered as
// prompt for the command line
p = vim_strrchr(prompt, '\n');
void f_setcmdpos(typval_T *argvars, typval_T *rettv);
int get_cmdline_firstc(void);
int get_list_range(char_u **str, int *num1, int *num2);
-void set_prompt(char_u* str);
char *did_set_cedit(optset_T *args);
int is_in_cmdwin(void);
char_u *script_get(exarg_T *eap, char_u *cmd);
call feedkeys(":call input('Answer?')\<CR>a\<CR>\<ESC>", "xt")
call assert_equal('Answer?', g:cmdprompt)
call assert_equal('', getcmdprompt())
+ call feedkeys(":\<CR>\<ESC>", "xt")
+ call assert_equal('', g:cmdprompt)
+ call assert_equal('', getcmdprompt())
+
+ let str = "C" .. repeat("c", 1023) .. "xyz"
+ call feedkeys(":call input('" .. str .. "')\<CR>\<CR>\<ESC>", "xt")
+ call assert_equal(str, g:cmdprompt)
+
+ call feedkeys(':call input("Msg1\nMessage2\nAns?")' .. "\<CR>b\<CR>\<ESC>", "xt")
+ call assert_equal('Ans?', g:cmdprompt)
+ call assert_equal('', getcmdprompt())
augroup test_CmdlineEnter
au!
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 742,
/**/
741,
/**/