Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Completion services + xterm auto-margin revisited



Andrej Borsenkow <Andrej.Borsenkow@xxxxxxxxxxxxxx> typed:
:Well, it was a knowhow of Geoff (I still shudder when looking at refresh
:code).

It's commented.  Well, the variables mostly are.  And it understands
am (automargin) ... mostly.  I've been taking a quick look at the
completion printing stuff.  I presume the bits I should be looking
at are:  Zle/complist.c:compprintfmt() and compprintlist()

Peter Stephenson <pws@xxxxxxx> typed:
:By the way, completion listing for `typeset -' seems to tickle a relative
:of an ancient bug with xterm auto-margin: one of the possible descriptions
:is exactly 80 characters, but doesn't cause wraparound since there's
:nothing to follow, and redisplaying the command line happens one line too
:high.

I have some vague memory of a discussion yonks ago (different to the
one referenced above, I think) about whether a newline should be printed
at the end of any list or such (hereafter I'm just calling them lists
but also refer to other outputs) - one point here is that all lists need
to be considered to have an extra line if the last line extends to the
right margin, especially for any comparisons with ``lines'' (term height)
so the top doesn't unexpectedly scroll off.  It's slightly ugly when the
list hits the bottom of the screen but I thought this happened.  Maybe
a couple of cases were missed.
Point is: if the last output line is term width then you should always
be printing "\n" (*) and presume an extra line in the calculations.

(*) it's safest for 99.9% of used terminals whether or not they're
    correctly reporting ``am'' capability (and if they're incorrectly
    reporting it they'll have other problems anyway)

Regards,
-- 
Geoff Wing : <gcw@xxxxxxxxx>
Rxvt Stuff : <gcw@xxxxxxxx>
Zsh Stuff  : <gcw@xxxxxxx>



Messages sorted by: Reverse Date, Date, Thread, Author