diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rwxr-xr-x | Completion/Base/_in_vared | 15 | ||||
-rw-r--r-- | Completion/Commands/_complete_debug | 1 | ||||
-rw-r--r-- | Src/Zle/complist.c | 23 |
4 files changed, 33 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog index a0bc00a29..aafc58f89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-05-25 Sven Wischnowsky <wischnow@zsh.org> + + * 11565: Completion/Base/_in_vared, Completion/Commands/_complete_debug, + Src/Zle/complist.c: force listing in _complete_debug; make + complist with list-scrolling stopt at the end of the list when + prompt would scroll it out; fix _in_vared to handle `foo[bar]' + 2000-05-24 Peter Stephenson <pws@cambridgesiliconradio.com> * 11561: Src/lex.c, Doc/Zsh/expn.yo: don't use RC_QUOTES in Posix diff --git a/Completion/Base/_in_vared b/Completion/Base/_in_vared index 4d8e814db..c21601cdf 100755 --- a/Completion/Base/_in_vared +++ b/Completion/Base/_in_vared @@ -5,10 +5,17 @@ local also # Completion inside vared. if [[ $compstate[vared] = *\[* ]]; then - # vared on an array-element - compstate[parameter]=${compstate[vared]%%\[*} - compstate[context]=-value- - also=value + if [[ $compstate[vared] = *\]* ]]; then + # vared on an array-element + compstate[parameter]=${${compstate[vared]%%\]*}//\[/-} + compstate[context]=value + also=-value- + else + # vared on an array-value + compstate[parameter]=${compstate[vared]%%\[*} + compstate[context]=value + also=-value- + fi else # vared on a parameter, let's see if it is an array compstate[parameter]=$compstate[vared] diff --git a/Completion/Commands/_complete_debug b/Completion/Commands/_complete_debug index 7672c75ea..aeb2027a7 100644 --- a/Completion/Commands/_complete_debug +++ b/Completion/Commands/_complete_debug @@ -22,6 +22,7 @@ unsetopt xtrace # _message -r "Trace output left in $tmp (up-history to view)" # print -sR "${VISUAL:-${EDITOR:-${PAGER:-more}}} $tmp ;: $w" _message -r "Trace output left in $tmp" + compstate[list]='list force' print -zR "${VISUAL:-${EDITOR:-${PAGER:-more}}} $tmp ;: $w" exec 2>&3 3>&- } diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c index e1538e35b..b6aa78bd7 100644 --- a/Src/Zle/complist.c +++ b/Src/Zle/complist.c @@ -1302,36 +1302,41 @@ compprintlist(int showall) if (nlnct <= 1) mscroll = 0; if (clearflag) { + int nl; + /* Move the cursor up to the prompt, if always_last_prompt * * is set and all that... */ if (mlbeg >= 0) { - if ((ml = listdat.nlines + nlnct) >= lines) { + if ((nl = listdat.nlines + nlnct) >= lines) { if (mhasstat) { putc('\n', shout); compprintfmt(NULL, 0, 1, 1, mline, NULL); } - ml = lines - 1; + nl = lines - 1; } else - ml--; - tcmultout(TCUP, TCMULTUP, ml); + nl--; + tcmultout(TCUP, TCMULTUP, nl); showinglist = -1; lastlistlen = listdat.nlines; - } else if ((ml = listdat.nlines + nlnct - 1) < lines) { + } else if ((nl = listdat.nlines + nlnct - 1) < lines) { if (mlbeg >= 0 && tccan(TCCLEAREOL)) tcout(TCCLEAREOL); - tcmultout(TCUP, TCMULTUP, ml); + tcmultout(TCUP, TCMULTUP, nl); showinglist = -1; lastlistlen = listdat.nlines; } else { clearflag = 0; - if (!asked) + if (!asked) { + mrestlines = (ml + nlnct > lines); compprintnl(ml); + } } - } else if (!asked) + } else if (!asked) { + mrestlines = (ml + nlnct > lines); compprintnl(ml); - + } listshown = (clearflag ? 1 : -1); mnew = 0; |