Mercurial > vim
comparison src/edit.c @ 22077:335365fcbb60 v8.2.1588
patch 8.2.1588: cannot read back the prompt of a prompt buffer
Commit: https://github.com/vim/vim/commit/077cc7aa0e0c431e97795612374fe17fe7c88803
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Sep 4 16:35:35 2020 +0200
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 https://github.com/vim/vim/issues/6851)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 04 Sep 2020 16:45:04 +0200 |
parents | 5ffe112b1afd |
children | 9bb1c984c4da |
comparison
equal
deleted
inserted
replaced
22076:1b8ace0b3487 | 22077:335365fcbb60 |
---|---|
1680 } | 1680 } |
1681 } | 1681 } |
1682 | 1682 |
1683 #if defined(FEAT_JOB_CHANNEL) || defined(PROTO) | 1683 #if defined(FEAT_JOB_CHANNEL) || defined(PROTO) |
1684 /* | 1684 /* |
1685 * Return the effective prompt for the specified buffer. | |
1686 */ | |
1687 char_u * | |
1688 buf_prompt_text(buf_T* buf) | |
1689 { | |
1690 if (buf->b_prompt_text == NULL) | |
1691 return (char_u *)"% "; | |
1692 return buf->b_prompt_text; | |
1693 } | |
1694 | |
1695 /* | |
1685 * Return the effective prompt for the current buffer. | 1696 * Return the effective prompt for the current buffer. |
1686 */ | 1697 */ |
1687 char_u * | 1698 char_u * |
1688 prompt_text(void) | 1699 prompt_text(void) |
1689 { | 1700 { |
1690 if (curbuf->b_prompt_text == NULL) | 1701 return buf_prompt_text(curbuf); |
1691 return (char_u *)"% "; | 1702 } |
1692 return curbuf->b_prompt_text; | 1703 |
1693 } | |
1694 | 1704 |
1695 /* | 1705 /* |
1696 * Prepare for prompt mode: Make sure the last line has the prompt text. | 1706 * Prepare for prompt mode: Make sure the last line has the prompt text. |
1697 * Move the cursor to this line. | 1707 * Move the cursor to this line. |
1698 */ | 1708 */ |