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

Re: Issue with insert-sections style



On Sep 9,  4:50pm, Julius Plenz wrote:
}
} If you use the _oldlist completer together with the no_list_ambiguous
} option the following bug occurs: When you have entered a man page name
} with a prefix that can only be expanded to man pages from one section,
} that section number gets inserted when drawing the listing, and then
} *again* when the user enters menu completion.

The trouble here is that the section number *and a trailing space* are
passed to compadd as a prefix of the manual page name to be completed.
On the subsequent TAB, that trailing space causes the section number
on the line to be treated as a different word, and therefore it is not
matched against the entries in the previously-generated completion list
when it is re-used by _oldlist.

This is a generic limitation of completion: it does not operates across
$IFS-delimited boundaries, so any ambiguous match that includes an un-
quoted $IFS character can produce confusion when completion is repeated
on one of the substrings of the match.

It might be possible to partly fix this in _oldlist by, e.g., testing
for ${#${(z)_lastcomp[unambiguous]}} > 1 and discarding the old list in
that case.  (Can't use that test directly because if ${(z)...} yeilds
only one word, ${#...} counts the number of characters, but you get the
idea.)



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