summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-09-04 16:35:35 +0200
committerBram Moolenaar <Bram@vim.org>2020-09-04 16:35:35 +0200
commit077cc7aa0e0c431e97795612374fe17fe7c88803 (patch)
tree80843d4928d91ca5f9d4c38d37807e0eb17bc4be /runtime
parenteadee486c70946ad0e1746d77898d6f4f4acc817 (diff)
patch 8.2.1588: cannot read back the prompt of a prompt bufferv8.2.1588
Problem: Cannot read back the prompt of a prompt buffer. Solution: Add prompt_getprompt(). (Ben Jackson, closes #6851)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/channel.txt10
-rw-r--r--runtime/doc/eval.txt14
-rw-r--r--runtime/doc/usr_41.txt1
3 files changed, 22 insertions, 3 deletions
diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt
index 84a344fa95..18b0232dfa 100644
--- a/runtime/doc/channel.txt
+++ b/runtime/doc/channel.txt
@@ -1,4 +1,4 @@
-*channel.txt* For Vim version 8.2. Last change: 2020 Jul 10
+*channel.txt* For Vim version 8.2. Last change: 2020 Sep 03
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -608,6 +608,10 @@ ch_logfile({fname} [, {mode}]) *ch_logfile()*
after every message, on Unix you can use "tail -f" to see what
is going on in real time.
+ To enable the log very early, to see what is received from a
+ terminal during startup, use |--cmd|: >
+ vim --cmd "call ch_logfile('logfile', 'w')"
+<
This function is not available in the |sandbox|.
NOTE: the channel communication is stored in the file, be
aware that this may contain confidential and privacy sensitive
@@ -1256,7 +1260,9 @@ After setting 'buftype' to "prompt" Vim does not automatically start Insert
mode, use `:startinsert` if you want to enter Insert mode, so that the user
can start typing a line.
-The text of the prompt can be set with the |prompt_setprompt()| function.
+The text of the prompt can be set with the |prompt_setprompt()| function. If
+no prompt is set with |prompt_setprompt()|, "% " is used. You can get the
+effective prompt text for a buffer, with |prompt_getprompt()|.
The user can go to Normal mode and navigate through the buffer. This can be
useful to see older output or copy text.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index a2e1af919f..130e6423b9 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2684,6 +2684,7 @@ popup_show({id}) none unhide popup window {id}
pow({x}, {y}) Float {x} to the power of {y}
prevnonblank({lnum}) Number line nr of non-blank line <= {lnum}
printf({fmt}, {expr1}...) String format text
+prompt_getprompt({buf}) String get prompt text
prompt_setcallback({buf}, {expr}) none set prompt callback function
prompt_setinterrupt({buf}, {text}) none set prompt interrupt function
prompt_setprompt({buf}, {text}) none set prompt text
@@ -7835,6 +7836,17 @@ printf({fmt}, {expr1} ...) *printf()*
arguments an error is given. Up to 18 arguments can be used.
+prompt_getprompt({buf}) *prompt_getprompt()*
+ Returns the effective prompt text for buffer {buf}. {buf} can
+ be a buffer name or number. |prompt-buffer|.
+
+ If the buffer doesn't exist or isn't a prompt buffer, an empty
+ string is returned.
+
+ Can also be used as a |method|: >
+ GetBuffer()->prompt_getprompt()
+
+
prompt_setcallback({buf}, {expr}) *prompt_setcallback()*
Set prompt callback for buffer {buf} to {expr}. When {expr}
is an empty string the callback is removed. This has only
@@ -7890,7 +7902,7 @@ prompt_setprompt({buf}, {text}) *prompt_setprompt()*
Can also be used as a |method|: >
GetBuffer()->prompt_setprompt('command: ')
-prop_ functions are documented here: |text-prop-functions|.
+prop_ functions are documented here: |text-prop-functions|
pum_getpos() *pum_getpos()*
If the popup menu (see |ins-completion-menu|) is not visible,
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index ff223e6aef..b11f0134f6 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -1118,6 +1118,7 @@ Tags: *tag-functions*
settagstack() modify the tag stack of a window
Prompt Buffer: *promptbuffer-functions*
+ prompt_getprompt() get the effective prompt text for a buffer
prompt_setcallback() set prompt callback for a buffer
prompt_setinterrupt() set interrupt callback for a buffer
prompt_setprompt() set the prompt text for a buffer