mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-23 04:30:24 +02:00
add RPS2 handling to "prompt bart", update help text, clean up indentation whitespace
This commit is contained in:
parent
b3aa3b7791
commit
1629d5bcbd
2 changed files with 33 additions and 11 deletions
|
@ -1,3 +1,8 @@
|
|||
2015-07-25 Barton E. Schaefer <schaefer@zsh.org>
|
||||
|
||||
* unposted: Functions/Prompts/prompt_bart_setup: add RPS2 handling,
|
||||
update help text, clean up indentation whitespace
|
||||
|
||||
2015-07-25 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* 35910: Src/input.c: Don't add to raw lex buffer if lex
|
||||
|
|
|
@ -48,9 +48,13 @@ prompt_bart_help () {
|
|||
When RPS1 (RPROMPT) is set before this prompt is selected and a
|
||||
fifth color is specified, that color is turned on before RPS1 is
|
||||
displayed and reset after it. Other color changes within RPS1, if
|
||||
any, remain in effect.
|
||||
any, remain in effect. This also applies to RPS2 (RPROMPT2).
|
||||
If a fifth color is specified and there is no RPS2, PS2 (PROMPT2)
|
||||
is colored and moved to RPS2. Changes to RPS1/RPS2 are currently
|
||||
not reverted when the theme is switched off. These work best with
|
||||
the TRANSIENT_RPROMPT option, which must be set separately.
|
||||
|
||||
This prompt hijacks psvar[7] through [9] to avoid having to reset
|
||||
This theme hijacks psvar[7] through [9] to avoid having to reset
|
||||
the entire PS1 string on every command. It uses TRAPWINCH to set
|
||||
the position of the upper right prompt on a window resize, so the
|
||||
prompt may not match the window width until the next command.
|
||||
|
@ -201,9 +205,22 @@ prompt_bart_setup () {
|
|||
|
||||
prompt_bart_ps1
|
||||
|
||||
if (($# > 4))
|
||||
then
|
||||
# No RPS1 by default because prompt_off_setup doesn't fix it.
|
||||
(($#RPS1 && $# > 4)) && RPS1="%F{$5}$RPS1%f"
|
||||
|
||||
if (($#RPS1))
|
||||
then
|
||||
RPS1="%F{$5}$RPS1%f"
|
||||
fi
|
||||
# RPS2 is less obvious so don't mind that it's not restored.
|
||||
if (($#RPS2))
|
||||
then
|
||||
RPS2="%F{$5}$RPS2%f"
|
||||
else
|
||||
RPS2="%F{$5}<${${PS2//\%_/%^}%> }%f"
|
||||
PS2=''
|
||||
fi
|
||||
fi
|
||||
# Paste our special commands into precmd and TRAPWINCH
|
||||
|
||||
add-zsh-hook precmd prompt_bart_precmd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue