mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 07:18:17 +00:00
vim-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 vim/vim#6851)077cc7aa0e
Updated prompt_getprompt() doc tocb80aa2d53
and removed mention of method syntax usage (not supported by Nvim).
This commit is contained in:
@@ -1604,13 +1604,20 @@ void edit_putchar(int c, bool highlight)
|
||||
}
|
||||
}
|
||||
|
||||
// Return the effective prompt for the current buffer.
|
||||
char_u *prompt_text(void)
|
||||
/// Return the effective prompt for the specified buffer.
|
||||
char_u *buf_prompt_text(const buf_T *const buf)
|
||||
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
|
||||
{
|
||||
if (curbuf->b_prompt_text == NULL) {
|
||||
return (char_u *)"% ";
|
||||
}
|
||||
return curbuf->b_prompt_text;
|
||||
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) FUNC_ATTR_WARN_UNUSED_RESULT
|
||||
{
|
||||
return buf_prompt_text(curbuf);
|
||||
}
|
||||
|
||||
// Prepare for prompt mode: Make sure the last line has the prompt text.
|
||||
|
Reference in New Issue
Block a user