Commit Graph

7 Commits

Author SHA1 Message Date
ridiculousfish
dce9453d25 Add a new completion test for optional arguments 2016-12-21 15:46:46 -08:00
ridiculousfish
05a640b027 Increase test coverage and improve completion commenting 2016-12-09 12:14:35 -08:00
ridiculousfish
8e1661cd22 Add a test for complete and -- 2016-12-08 02:00:24 -08:00
ridiculousfish
e395a0eb69 Migrate PATH-completion logic from complete.cpp to expand.cpp
Prior to this fix, when completing a command that doesn't have a /, we
would prepend each component of PATH and then expand the whole thing. So
any special characters in the PATH would be interpreted when performing
tab completion.

With this fix, we pull the PATH resolution out of complete.cpp and
migrate it to expand.cpp. This unifies nicely with the CDPATH resolution
already in that file. This requires introducing a new expand flag
EXPAND_SPECIAL_FOR_COMMAND, which is analogous to EXPAND_SPECIAL_CD
(which is renamed to EXPAND_SPECIAL_FOR_CD). This flag tells expand to
resolve paths against PATH instead of the working directory.

Fixes #952
2016-04-07 20:15:32 -07:00
Kevin Ballard
8a3cf144f2 Don't include child directories of $PATH in completions
Directories are completed like commands, because of implicit cd.
However, directories found inside $PATH entries should not be completed,
as implicit cd doesn't work there. Similarly, directories should not be
completed after the `command` builtin.

Fixes #1695.
2014-09-20 00:31:33 -07:00
Kevin Ballard
90a4fd34d2 Add tests for the various complete -e changes 2014-09-02 15:30:58 -07:00
ridiculousfish
c15975113a Fix for https://github.com/ridiculousfish/fishfish/issues/2 2012-05-11 18:59:38 -07:00