aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-04-21 21:23:04 -0400
committerGitHub <noreply@github.com>2021-04-21 21:23:04 -0400
commit4570d04b16b4de0731455681f4db4bd27c77fc4c (patch)
tree4e06c4bfbde3a5db8ced56f9d2a4f7f7a2f6e772 /src/nvim/edit.c
parentc37eaf574673d1cc7c7cb1a2c40c2ac45514afb5 (diff)
parentff198bb78a34f4b388efe1b45930031b39ae5810 (diff)
downloadrneovim-4570d04b16b4de0731455681f4db4bd27c77fc4c.tar.gz
rneovim-4570d04b16b4de0731455681f4db4bd27c77fc4c.tar.bz2
rneovim-4570d04b16b4de0731455681f4db4bd27c77fc4c.zip
Merge pull request #14411 from seandewar/vim-8.2.1588
vim-patch:8.2.1588 - port `prompt_getprompt()`
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index f2fddc89fe..999cc74185 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -1604,13 +1604,20 @@ void edit_putchar(int c, bool highlight)
}
}
+/// 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 (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)
+char_u *prompt_text(void) FUNC_ATTR_WARN_UNUSED_RESULT
{
- 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.