From: mason@primenet.com.au (Geoff Wing)
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: 3.1.5-pws-15: multiline prompt
Date: 25 Apr 1999 15:22:30 GMT [thread overview]
Message-ID: <slrn7i6cpm.crr.mason@coral.primenet.com.au> (raw)
In-Reply-To: <slrn7i6a1p.6s3.mason@coral.primenet.com.au>
Heyla,
see discussion under "yet another undesired 3.1.5-pws-15 change"
This should do what you want:
*** prompt.c.org Thu Nov 12 03:04:38 1998
--- prompt.c Mon Apr 26 01:15:25 1999
***************
*** 232,238 ****
break;
case 'l':
*bp = '\0';
! countprompt(bufline, &t0, 0);
if (t0 >= arg)
test = 1;
break;
--- 232,238 ----
break;
case 'l':
*bp = '\0';
! countprompt(bufline, &t0, 0, 0);
if (t0 >= arg)
test = 1;
break;
***************
*** 678,688 ****
/**/
void
! countprompt(char *str, int *wp, int *hp)
{
int w = 0, h = 1;
int s = 1;
for(; *str; str++) {
if(*str == Meta)
str++;
if(*str == Inpar)
--- 678,692 ----
/**/
void
! countprompt(char *str, int *wp, int *hp, int overf)
{
int w = 0, h = 1;
int s = 1;
for(; *str; str++) {
+ if(w >= columns) {
+ w = 0;
+ h++;
+ }
if(*str == Meta)
str++;
if(*str == Inpar)
***************
*** 694,705 ****
else if(s) {
if(*str == '\t')
w = (w | 7) + 1;
! else if(*str == '\n')
! w = columns;
! else
w++;
}
! if(w >= columns) {
w = 0;
h++;
}
--- 698,712 ----
else if(s) {
if(*str == '\t')
w = (w | 7) + 1;
! else if(*str == '\n') {
! w = 0;
! h++;
! } else
w++;
}
! }
! if(w >= columns) {
! if (!overf || w > columns) {
w = 0;
h++;
}
*** Zle/zle_refresh.c.org Tue Apr 13 18:07:18 1999
--- Zle/zle_refresh.c Mon Apr 26 01:11:29 1999
***************
*** 96,101 ****
--- 96,102 ----
olnct, /* previous number of lines */
ovln, /* previous video cursor position line */
lpromptw, rpromptw, /* prompt widths on screen */
+ lpromptwof, /* left prompt width with real end position */
lprompth, /* lines taken up by the prompt */
rprompth, /* right prompt height */
vcs, vln, /* video cursor position column & line */
***************
*** 141,148 ****
*obuf[ln] = '\0';
}
! countprompt(lpromptbuf, &lpromptw, &lprompth);
! countprompt(rpromptbuf, &rpromptw, &rprompth);
if (lpromptw) {
memset(nbuf[0], ' ', lpromptw);
--- 142,155 ----
*obuf[ln] = '\0';
}
! countprompt(lpromptbuf, &lpromptwof, &lprompth, 1);
! countprompt(rpromptbuf, &rpromptw, &rprompth, 0);
! if (lpromptwof != winw)
! lpromptw = lpromptwof;
! else {
! lpromptw = 0;
! lprompth++;
! }
if (lpromptw) {
memset(nbuf[0], ' ', lpromptw);
***************
*** 327,333 ****
vcs = 0;
else if (!clearflag && lpromptbuf[0]) {
zputs(lpromptbuf, shout);
! if (lpromptw == 0)
zputs("\n", shout); /* works with both hasam and !hasam */
}
if (clearflag) {
--- 334,340 ----
vcs = 0;
else if (!clearflag && lpromptbuf[0]) {
zputs(lpromptbuf, shout);
! if (lpromptwof == winw)
zputs("\n", shout); /* works with both hasam and !hasam */
}
if (clearflag) {
***************
*** 947,953 ****
zputc('\r', shout);
tc_upcurs(lprompth - 1);
zputs(lpromptbuf, shout);
! if (lpromptw == 0)
zputs("\n", shout); /* works with both hasam and !hasam */
}
i = lpromptw;
--- 954,960 ----
zputc('\r', shout);
tc_upcurs(lprompth - 1);
zputs(lpromptbuf, shout);
! if (lpromptwof == winw)
zputs("\n", shout); /* works with both hasam and !hasam */
}
i = lpromptw;
--
Geoff Wing <gcw@pobox.com> Mobile : (Australia) 0413 431 874 <<<new
Work URL: http://www.primenet.com.au/ Ego URL: http://pobox.com/~gcw/
next prev parent reply other threads:[~1999-04-25 15:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-04-23 10:59 yet another undesired 3.1.5-pws-15 change Sven Wischnowsky
1999-04-24 3:11 ` Timothy J Luoma
1999-04-25 13:44 ` Peter Stephenson
1999-04-25 14:35 ` Geoff Wing
1999-04-25 15:22 ` Geoff Wing [this message]
[not found] ` <990423234917.ZM30140@candle.brasslantern.com>
[not found] ` <199904241324.JAA23300@ocalhost>
[not found] ` <990424092703.ZM32177@candle.brasslantern.com>
[not found] ` <199904302157.RAA26524@ocalhost>
[not found] ` <990504100735.ZM28408@candle.brasslantern.com>
1999-05-11 2:40 ` success (mostly) pws 17 under NeXTStep 3.3 Timothy J Luoma
1999-05-11 8:06 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=slrn7i6cpm.crr.mason@coral.primenet.com.au \
--to=mason@primenet.com.au \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).