aboutsummaryrefslogtreecommitdiffstats
path: root/commands/util_test.go
Commit message (Collapse)AuthorAgeFilesLines
* completion: complete paths with FilterListHEADdevelAndrew Jeffery13 days1-8/+31
| | | | | | | | | | | | Make the completion filtering for paths use the standard FilterList function. This leads to fuzzy filtering if configured, as per other completions. Changelog-changed: Path completion now uses the normal filtering mechanism, respecting case sensitivity and the fuzzy completion option. Signed-off-by: Andrew Jeffery <dev@jeffas.net> Acked-by: Robin Jarry <robin@jarry.cc>
* cd: fix completion of folders with a spaceRobin Jarry2024-01-171-1/+12
| | | | | | | | | | | | | | Folders that contain spaces are surrounded by quotes. They can never end with '/'. Hence they are never returned in the completion results. Update CompletePath with an additional onlyDirs argument to take care of this before quotes are inserted. Fixes: abe228b14d97 ("commands: use completion from go-opt") Fixes: https://todo.sr.ht/~rjarry/aerc/204 Reported-by: Bence Ferdinandy <bence@ferdinandy.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* commands: simplify CompletePathRobin Jarry2024-01-171-0/+54
This function is overly complex, has code duplication and is not preserving user input (converting all paths to absolute paths). Simplify it and avoid converting relative paths to absolute ones. Add unit tests to ensure it works as expected. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>