From 5d11abfa3bf4f3a133f654c730cde752939376a1 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Thu, 31 Jan 2002 14:44:06 +0000 Subject: 16492: add RPROMPT2 variable for right prompts in multi-line commands --- ChangeLog | 5 +++++ Doc/Zsh/params.yo | 9 +++++++++ Src/input.c | 5 ++++- Src/params.c | 7 +++++-- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b0d053427..393281cf8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-01-31 Oliver Kiddle + + * Derek Peschel: 16492: Src/params.c, Src/input.c, Doc/Zsh/params.yo: + add RPROMPT2 variable for right prompts in multi-line commands + 2002-01-31 Andrew Main (Zefram) * 16527: Src/Zle/zle_refresh.c: Don't lose the rprompt when diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo index 9c17117a3..fb83863a1 100644 --- a/Doc/Zsh/params.yo +++ b/Doc/Zsh/params.yo @@ -966,6 +966,15 @@ when the primary prompt is being displayed on the left. This does not work if the tt(SINGLELINEZLE) option is set. It is expanded in the same way as tt(PS1). ) +vindex(RPROMPT2) +xitem(tt(RPROMPT2) ) +vindex(RPS2) +item(tt(RPS2) )( +This prompt is displayed on the right-hand side of the screen +when the secondary prompt is being displayed on the left. +This does not work if the tt(SINGLELINEZLE) option is set. +It is expanded in the same way as tt(PS2). +) vindex(SAVEHIST) item(tt(SAVEHIST))( The maximum number of history events to save in the history file. diff --git a/Src/input.c b/Src/input.c index ba01dd068..a95dac52c 100644 --- a/Src/input.c +++ b/Src/input.c @@ -226,8 +226,11 @@ inputline(void) /* If reading code interactively, work out the prompts. */ if (interact && isset(SHINSTDIN)) { - if (!isfirstln) + if (!isfirstln) { ingetcpmptl = prompt2; + if (rprompt2) + ingetcpmptr = rprompt2; + } else { ingetcpmptl = prompt; if (rprompt) diff --git a/Src/params.c b/Src/params.c index 8db358b07..ba4776423 100644 --- a/Src/params.c +++ b/Src/params.c @@ -65,6 +65,7 @@ char *argzero, /* $0 */ *prompt4, /* $PROMPT4 */ *readnullcmd, /* $READNULLCMD */ *rprompt, /* $RPROMPT */ + *rprompt2, /* $RPROMPT2 */ *sprompt, /* $SPROMPT */ *wordchars, /* $WORDCHARS */ *zsh_name; /* $ZSH_NAME */ @@ -193,12 +194,14 @@ IPDEF7("OPTARG", &zoptarg), IPDEF7("NULLCMD", &nullcmd), IPDEF7("POSTEDIT", &postedit), IPDEF7("READNULLCMD", &readnullcmd), -IPDEF7("RPROMPT", &rprompt), IPDEF7("PS1", &prompt), +IPDEF7("RPS1", &rprompt), +IPDEF7("RPROMPT", &rprompt), IPDEF7("PS2", &prompt2), +IPDEF7("RPS2", &rprompt2), +IPDEF7("RPROMPT2", &rprompt2), IPDEF7("PS3", &prompt3), IPDEF7("PS4", &prompt4), -IPDEF7("RPS1", &rprompt), IPDEF7("SPROMPT", &sprompt), IPDEF7("0", &argzero), -- cgit 1.4.1