1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-03 10:21:46 +02:00

25242: Mikael V prompt test for contents of psvar

This commit is contained in:
Peter Stephenson 2008-06-24 08:44:14 +00:00
parent 0d7df628a4
commit a440669201
3 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2008-06-24 Peter Stephenson <pws@csr.com>
* 25242: Mikael: Doc/Zsh/prompt.yo, Src/prompt.c: add V prompt
test for contents of psvar.
2008-06-23 Peter Stephenson <pws@csr.com>
* 25237: Doc/Zsh/tcpsys.yo, Functions/TCP/tcp_open: make

View file

@ -274,6 +274,8 @@ sitem(tt(S))(True if the tt(SECONDS) parameter is at least var(n).)
sitem(tt(T))(True if the time in hours is equal to var(n).)
sitem(tt(t))(True if the time in minutes is equal to var(n).)
sitem(tt(v))(True if the array tt(psvar) has at least var(n) elements.)
sitem(tt(V))(True if element var(n) of the array tt(psvar) is set and
non-empty.)
sitem(tt(w))(True if the day of the week is equal to var(n) (Sunday = 0).)
endsitem()
)

View file

@ -321,6 +321,12 @@ putpromptchar(int doprint, int endchar, unsigned int *txtchangep)
if (arrlen(psvar) >= arg)
test = 1;
break;
case 'V':
if (arrlen(psvar) >= arg) {
if (*psvar[(arg ? arg : 1) - 1])
test = 1;
}
break;
case '_':
test = (cmdsp >= arg);
break;