mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.2.1588: cannot read back the prompt of a prompt buffer
Problem: Cannot read back the prompt of a prompt buffer. Solution: Add prompt_getprompt(). (Ben Jackson, closes #6851)
This commit is contained in:
16
src/edit.c
16
src/edit.c
@@ -1681,17 +1681,27 @@ edit_putchar(int c, int highlight)
|
||||
}
|
||||
|
||||
#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
|
||||
/*
|
||||
* Return the effective prompt for the specified buffer.
|
||||
*/
|
||||
char_u *
|
||||
buf_prompt_text(buf_T* buf)
|
||||
{
|
||||
if (buf->b_prompt_text == NULL)
|
||||
return (char_u *)"% ";
|
||||
return buf->b_prompt_text;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the effective prompt for the current buffer.
|
||||
*/
|
||||
char_u *
|
||||
prompt_text(void)
|
||||
{
|
||||
if (curbuf->b_prompt_text == NULL)
|
||||
return (char_u *)"% ";
|
||||
return curbuf->b_prompt_text;
|
||||
return buf_prompt_text(curbuf);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Prepare for prompt mode: Make sure the last line has the prompt text.
|
||||
* Move the cursor to this line.
|
||||
|
Reference in New Issue
Block a user