diff options
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index f2fddc89fe..56b563cba0 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -992,6 +992,7 @@ static int insert_handle_key(InsertState *s) case K_LEFTDRAG: case K_LEFTRELEASE: case K_LEFTRELEASE_NM: + case K_MOUSEMOVE: case K_MIDDLEMOUSE: case K_MIDDLEDRAG: case K_MIDDLERELEASE: @@ -1604,13 +1605,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. |