From 184fef90189dbb078cd374fd48cf7252b178e543 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Fri, 5 Nov 1999 09:10:41 +0000 Subject: zsh-workers/8560 --- Src/Zle/complete.export | 60 ++------------------------ Src/Zle/compresult.c | 110 ------------------------------------------------ Src/Zle/zle.export | 25 ++--------- Src/Zle/zle_tricky.c | 110 ++++++++++++++++++++++++++++++++++++++++++++++++ Src/zsh.export | 3 +- 5 files changed, 118 insertions(+), 190 deletions(-) diff --git a/Src/Zle/complete.export b/Src/Zle/complete.export index eac9592e7..0b4a5ee3a 100644 --- a/Src/Zle/complete.export +++ b/Src/Zle/complete.export @@ -1,29 +1,16 @@ #! accept_last addexpl -addzlefunction add_bmatchers add_match_data allccs amatches asklist -autoq begcmgroup -bindkey bmatchers -brbeg -brend calclist check_param -clearflag -clearlist -clearscreen -clwnum -clwords -clwpos -clwsize cmatcher -cmdstr compcurrent compheap compisuffix @@ -40,87 +27,46 @@ comp_str cpcmatcher ctokenize curexpl -deletezlefunction do_menucmp do_single -dupbrinfo -dupstrspace endcmgroup -fixsuffix -foredel -freebrinfo freecmatcher freematches -getkeycmd get_user_var hasmatched hasoldlist haspattern +hasperm ignore_prefix ignore_suffix -inbackt -incompctlfunc -incompfunc -instring -insubscr invalidate_list ipre ispar ispattern isuf keypm -lastambig -lastbrbeg -lastbrend lastlmatches lastmatches linkkeymap -linredir linwhat listdat -listshown +lmatches matchers matches menuacc -menucmp -menucomplete mflags minfo mnum mstack -nbrbeg -nbrend -newkeymap -nlnct nmatches -offs onlyexpl parse_cmatcher -pfxlen pmatches -printfmt printlist -qipre -qisuf -redisplay -refthingy rembslash restrict_range -reversemenucomplete ripre -selectlocalmap set_gmatcher set_list_array -showinglist -spaceinline -thingies -thingytab -ungetkeycmd -unlinkkeymap update_bmatchers -usemenu -validlist -wb -we -zlenoargs -zrefresh +ztat diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c index 70be906db..b8132057b 100644 --- a/Src/Zle/compresult.c +++ b/Src/Zle/compresult.c @@ -1124,116 +1124,6 @@ comp_list(char *v) onlyexpl = (v && strstr(v, "expl")); } -/* This is used to print the explanation string. * - * It returns the number of lines printed. */ - -/**/ -int -printfmt(char *fmt, int n, int dopr, int doesc) -{ - char *p = fmt, nc[DIGBUFSIZE]; - int l = 0, cc = 0, b = 0, s = 0, u = 0, m; - - for (; *p; p++) { - /* Handle the `%' stuff (%% == %, %n == ). */ - if (doesc && *p == '%') { - if (*++p) { - m = 0; - switch (*p) { - case '%': - if (dopr) - putc('%', shout); - cc++; - break; - case 'n': - sprintf(nc, "%d", n); - if (dopr) - fprintf(shout, nc); - cc += strlen(nc); - break; - case 'B': - b = 1; - if (dopr) - tcout(TCBOLDFACEBEG); - break; - case 'b': - b = 0; m = 1; - if (dopr) - tcout(TCALLATTRSOFF); - break; - case 'S': - s = 1; - if (dopr) - tcout(TCSTANDOUTBEG); - break; - case 's': - s = 0; m = 1; - if (dopr) - tcout(TCSTANDOUTEND); - break; - case 'U': - u = 1; - if (dopr) - tcout(TCUNDERLINEBEG); - break; - case 'u': - u = 0; m = 1; - if (dopr) - tcout(TCUNDERLINEEND); - break; - case '{': - for (p++; *p && (*p != '%' || p[1] != '}'); p++, cc++) - if (dopr) - putc(*p, shout); - if (*p) - p++; - else - p--; - break; - } - if (dopr && m) { - if (b) - tcout(TCBOLDFACEBEG); - if (s) - tcout(TCSTANDOUTBEG); - if (u) - tcout(TCUNDERLINEBEG); - } - } else - break; - } else { - cc++; - if (*p == '\n') { - if (dopr) { - if (tccan(TCCLEAREOL)) - tcout(TCCLEAREOL); - else { - int s = columns - 1 - (cc % columns); - - while (s-- > 0) - putc(' ', shout); - } - } - l += 1 + (cc / columns); - cc = 0; - } - if (dopr) - putc(*p, shout); - } - } - if (dopr) { - if (tccan(TCCLEAREOL)) - tcout(TCCLEAREOL); - else { - int s = columns - 1 - (cc % columns); - - while (s-- > 0) - putc(' ', shout); - } - } - return l + (cc / columns); -} - /* This skips over matches that are not to be listed. */ /**/ diff --git a/Src/Zle/zle.export b/Src/Zle/zle.export index c9fd398ed..29961ef3d 100644 --- a/Src/Zle/zle.export +++ b/Src/Zle/zle.export @@ -1,8 +1,6 @@ #! acceptlast addzlefunction -amatches -asklist autoq backdel backkill @@ -10,7 +8,6 @@ bindk bindkey brbeg brend -calclist cfargs cfret clearflag @@ -23,32 +20,29 @@ cmdstr compfunc compwidget deletezlefunction -do_menucmp -do_single +dupbrinfo dupstrspace fixsuffix foredel forekill -freematches +freebrinfo getkey getkeycmd getzlequery hascompmod -hasoldlist -hasperm inbackt +incompctlfunc incompfunc instring inststrlen insubscr invalidatelist iremovesuffix +keymapnamtab lastambig lastbrbeg lastbrend lastcmd -lastlmatches -lastmatches lastpostbr lastprebr lbindk @@ -56,32 +50,24 @@ linarr lincmd linkkeymap linredir -listdat listshown -lmatches makeparamsuffix makesuffix makesuffixstr makezleparams -menuacc menucmp menucomplete metafy_line -minfo nbrbeg nbrend newkeymap nlnct -nmatches offs -onlyexpl origcs origline origll pfxlen -pmatches printfmt -printlist qipre qisuf rdstr @@ -91,10 +77,8 @@ reversemenucomplete selectlocalmap showagain showinglist -skipnolist spaceinline strbpcmp -strbpcmp suffixlen tcmultout tcout @@ -115,4 +99,3 @@ zlenoargs zmod zrefresh zsetterm -ztat diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index 09a15d407..6a17c46d0 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -1739,6 +1739,116 @@ strbpcmp(char **aa, char **bb) return (int)(*a - *b); } +/* This is used to print the strings (e.g. explanations). * + * It returns the number of lines printed. */ + +/**/ +int +printfmt(char *fmt, int n, int dopr, int doesc) +{ + char *p = fmt, nc[DIGBUFSIZE]; + int l = 0, cc = 0, b = 0, s = 0, u = 0, m; + + for (; *p; p++) { + /* Handle the `%' stuff (%% == %, %n == ). */ + if (doesc && *p == '%') { + if (*++p) { + m = 0; + switch (*p) { + case '%': + if (dopr) + putc('%', shout); + cc++; + break; + case 'n': + sprintf(nc, "%d", n); + if (dopr) + fprintf(shout, nc); + cc += strlen(nc); + break; + case 'B': + b = 1; + if (dopr) + tcout(TCBOLDFACEBEG); + break; + case 'b': + b = 0; m = 1; + if (dopr) + tcout(TCALLATTRSOFF); + break; + case 'S': + s = 1; + if (dopr) + tcout(TCSTANDOUTBEG); + break; + case 's': + s = 0; m = 1; + if (dopr) + tcout(TCSTANDOUTEND); + break; + case 'U': + u = 1; + if (dopr) + tcout(TCUNDERLINEBEG); + break; + case 'u': + u = 0; m = 1; + if (dopr) + tcout(TCUNDERLINEEND); + break; + case '{': + for (p++; *p && (*p != '%' || p[1] != '}'); p++, cc++) + if (dopr) + putc(*p, shout); + if (*p) + p++; + else + p--; + break; + } + if (dopr && m) { + if (b) + tcout(TCBOLDFACEBEG); + if (s) + tcout(TCSTANDOUTBEG); + if (u) + tcout(TCUNDERLINEBEG); + } + } else + break; + } else { + cc++; + if (*p == '\n') { + if (dopr) { + if (tccan(TCCLEAREOL)) + tcout(TCCLEAREOL); + else { + int s = columns - 1 - (cc % columns); + + while (s-- > 0) + putc(' ', shout); + } + } + l += 1 + (cc / columns); + cc = 0; + } + if (dopr) + putc(*p, shout); + } + } + if (dopr) { + if (tccan(TCCLEAREOL)) + tcout(TCCLEAREOL); + else { + int s = columns - 1 - (cc % columns); + + while (s-- > 0) + putc(' ', shout); + } + } + return l + (cc / columns); +} + /* This is used to print expansions. */ /**/ diff --git a/Src/zsh.export b/Src/zsh.export index 63207d613..d35bffc69 100644 --- a/Src/zsh.export +++ b/Src/zsh.export @@ -1,4 +1,5 @@ #! +SHTTY addbuiltins addconddefs addedx @@ -145,7 +146,6 @@ intvarsetfn inwhat isfirstln jobtab -keymapnamtab lastpid lastval lchdir @@ -200,7 +200,6 @@ postedit ppid prefork prepromptfns -printfmt printif printparamnode printqt -- cgit 1.4.1