Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Question
- X-seq: zsh-workers 10708
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: Question
- Date: Wed, 12 Apr 2000 16:06:33 +0000
- In-reply-to: <200004120851.KAA07258@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <200004120851.KAA07258@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
On Apr 12, 10:51am, Sven Wischnowsky wrote:
} Subject: Re: Question
}
} > (1) Format up the completion listing as if it were going to shout, but
} > stuff it all into a string instead. (That's probably happening already,
} > I didn't look.) Then point a parameter at that string and invoke vared.
} > ZLE already takes care of paging up and down.
}
} The first one is a real problem that can't be avoided with this
} solution: the colouring that's possible with complist would be lost.
I suppose so.
} I'm not sure what could
} happen when we allow something like vared (with possible user defined
} widgets being called) while the completion list is displayed.
Yes, I wondered about the warnings that cna be printed about not using
zle recursively. You might have to save and restore the whole state of
the completion system to be entirely safe, which could get ugly.
} > (2) Use a "select x in ..." loop over the values. As of some while ago,
} > select already knows how to page through screenfuls of choices. You
} > can't go backwards, but it cycles to the top after reaching the bottom.
}
} I never liked select and fiddling with numbers in completion lists
} seems weird to me. But then: `select already knows how to page' and `I
} don't think we should be "in the business" of implementing pagers'.
There's a difference between pausing after N lines and implementing a
pager. A pager implies being able to scroll one or a few lines at a
time, not by whole screenfuls, and being able to move backwards as well
as forwards (or at least that's what it implies nowadays).
Is the following a pager?
integer i=0
while read -E
do
(( ++i == LINES-2 )) &&
{ i=0; read -q '?Continue? [no] ' </dev/tty || break }
done
(The above reveals a possible bug: "read -q" prints a prompt only if
standard input is a TTY, but it always reads from the TTY if there is
one. So I had to throw in that redirection.)
} A final thought: complist is intended as the module to allow fancy
} completion list handling... would it be acceptable to add this
} scrolling stuff only to it?
If it's getting added, that's the place for it.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author